Skip to content

-I of image does not invert the colors of a 1-bit image #8795

Closed

Description

@yvonnefroehlich

Description of the problem

See also: GenericMappingTools/pygmt#4089 (comment)

Using -I of image to invert the colors of a 1-bit image does not work (anymore).

Full script that generated the error

(I)

gmt image @vader1.png -png image_gmt

(II)

gmt image @vader1.png -I -png image_I_gmt

Full error message

No error or warning messages occur.

Actual outcome
(I)
Image

(II)
Image

Expected outcome

The black and white pixels of the image should be flipped when using -I (second image).

System information

  • Operating system: Windows 10
  • GMT version (gmt --version): 6.4.0, 6.5.0, 6.7.0_7026382_2025.08.23

Activity

  1. added
    bug
    on Sep 15, 2025
  2. changed the title [-]-I of image does not invert the colors of a 1-bit image[/-] [+]`-I` of `image` does not invert the colors of a 1-bit image[/+] on Sep 15, 2025
  3. ES-Solar commented on Nov 20, 2025

    @ES-Solar
    Collaborator

    The bug appears to be that the 1-bit image is being converted to a 24-bit depth image which then causes '-I' to be ignored. The issue also appears to have something to do with perhaps a colormap in the png file that causes the single bits to be translated into RGB values.

  4. added a commit that references this issue on Dec 10, 2025
    5e90e1e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions