-
Notifications
You must be signed in to change notification settings - Fork 139
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
Add an option to decode to a premultiplied form #271
Comments
If you want premultiplied alpha, isn't the right approach to apply it yourself before saving the PNG? |
No, PNGs are stored using unpremultiplied alpha. Premultiplying before saving will cause other png decoders to apply the alpha twice and won't help with existing images. |
I've clarified the title to make it clearer that this would probably be an optional output transformation. |
There are at least two case where applying the transformation at decode time, instead of later, is advantageous compared to a post-processing step after the full buffer is decoded. There is no general benefit however, so their implementation mustn't have too much of a complexity overhead.
|
Applying at decode time can also avoid cache thrashing on large images. |
Sorry for the noob question: If |
Consumers of PNG images often want the alpha premultiplied. See jrmuizel/raqote#167
The text was updated successfully, but these errors were encountered: