Skip to content

ICO: Ignore AND mask for 32bpp images with native alpha#3002

Merged
197g merged 3 commits into
image-rs:mainfrom
mpospelova:remove-and-mask
Jun 3, 2026
Merged

ICO: Ignore AND mask for 32bpp images with native alpha#3002
197g merged 3 commits into
image-rs:mainfrom
mpospelova:remove-and-mask

Conversation

@mpospelova

Copy link
Copy Markdown
Contributor

2bpp BMPs already have a native alpha channel, so applying the 1-bit AND mask is destructive, as it overwrites real alpha values.

@RunDevelopment

Copy link
Copy Markdown
Member

Could you please show that this is correct? Just because applying the AND mask is destructive doesn't mean we can just ignore it. So could you please find relevant documentation that supports your change and/or show that other widely used decoders behave equivalently?

I think an example image would really help here. Then we could just see what other programs are doing.

Maria Pospelova added 2 commits June 2, 2026 14:18
@mpospelova

Copy link
Copy Markdown
Contributor Author

@RunDevelopment thank you for the comment! As I've understood it from here, Windows looks at the alpha channel for 32bpp images during standard rendering and does not apply the AND mask

@197g 197g left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you, behavior checks against Chromium, Firefox, feh, eog also check out with the test image.

@197g 197g merged commit 58b1ff5 into image-rs:main Jun 3, 2026
31 checks passed
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