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

Allowing LA and RGBA PNGs with a tRNS chunk #146

Closed
solidpixel opened this issue Apr 18, 2024 · 2 comments
Closed

Allowing LA and RGBA PNGs with a tRNS chunk #146

solidpixel opened this issue Apr 18, 2024 · 2 comments

Comments

@solidpixel
Copy link

solidpixel commented Apr 18, 2024

The PNG standard disallows tRNS chunks for color types 4 and 6

https://www.w3.org/TR/2003/REC-PNG-20031110/#11tRNS
A tRNS chunk shall not appear for colour types 4 and 6, since a full alpha channel is already present in those cases.

... however it seems that some popular PNG creating applications create these, and many other PNG libraries (e.g. libpng) will load the image and ignore the tRNS chunk in these cases. Would it be possible to do something similar in the Wuffs library (either by default, or with an opt-in permissive mode (which could be compile time))?

@solidpixel solidpixel changed the title Allowing RGBA PNGs with a tRNS chunk Allowing LA and RGBA PNGs with a tRNS chunk Apr 18, 2024
@solidpixel
Copy link
Author

Example PNG triggering this can be found on the Arm ASTC compressor project issue: ARM-software/astc-encoder#463

nigeltao added a commit that referenced this issue Apr 19, 2024
This backports commit da0d51d from the
main branch (working on an unstable v0.4) to the v0.3 branch.

Updates #146
nigeltao added a commit that referenced this issue Apr 19, 2024
@solidpixel
Copy link
Author

Thank you for the fast response,

Cheers,
Pete

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

1 participant