Skip to content

Conversation

@ES-Solar
Copy link
Contributor

@ES-Solar ES-Solar commented Dec 9, 2025

Description of proposed changes

Png bit map images are converted to 24-bit internally and this conversion seemed to be confusing the -I logic. For a 2-color color map image, the logic was adjusted so treat the 2-color color map image as a bitmap image and also support replacing the foreground and background colors.

…8795)

- Detect 2-color (1-bit) images and swap colormap entries when -I is used
- Apply -G color replacements to colormap before expansion to RGB
- Ensures -I option works correctly for 1-bit PNG images

Fixes GenericMappingTools#8795
)

- Tests normal image, inverted image, and inverted with color changes
- Verifies fix for issue GenericMappingTools#8795
Copy link
Member

@joa-quim joa-quim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I run the tests locally and this worked, thanks. But for committing, an "original" PS file must be submitted to the DVC otherwise the new test will always fail (and please don't ask me how to. I hate the DVC, it never works for me).

@seisman seisman merged commit 5e90e1e into GenericMappingTools:master Dec 10, 2025
10 of 13 checks passed
@seisman
Copy link
Member

seisman commented Dec 10, 2025

I can confirm that it works. I'll add the baseline image later.

seisman added a commit that referenced this pull request Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants