Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PNG with color type grayscaleAlpha has wrong behaviour #606

Open
NicolaVerbeeck opened this issue Jan 15, 2024 · 4 comments
Open

PNG with color type grayscaleAlpha has wrong behaviour #606

NicolaVerbeeck opened this issue Jan 15, 2024 · 4 comments

Comments

@NicolaVerbeeck
Copy link

  1. It decodes as having no alpha (given that alpha is defined as numChannels == 4) this would fail (numChannels == 2)
  2. Converting it to a 4 channel image causes a wrong conversion

Test data:
test

Resulting converted image:
out

@brendan-duncan
Copy link
Owner

I pushed an update for this in 9f39c25

@NicolaVerbeeck
Copy link
Author

You sir, are awesome!

Will take a look at it

@NicolaVerbeeck
Copy link
Author

Checked it and now it works though we can't determine if the original image has alpha. Any ideas?

@brendan-duncan
Copy link
Owner

2 channel images are almost always luminance-alpha. I see Image.hasAlpha wasn't updated, I'll do that. Pixel r, g,, b, and a methods were updated.

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

No branches or pull requests

2 participants