-
Notifications
You must be signed in to change notification settings - Fork 3
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
Implement premultiplied alpha in PixelType #52
Comments
In future world, PixelType will probably explode in complexity with opEquals being non-trivial. What would be those additions?
|
The reading of the color library made by Manu is interesting and points towards the likely shape of a future "Colorspace" concept, which would either the same as PixelType or PixelType would be purely derived from it. Now, is there a way to support the less types "legacy" PixelType? |
Very much related to #20 |
Important to note that some practical overlay images are largely transparent and can benefit a lot from premultiplied encoding, but not really from "ignore color for fully transparent areas" which is a less strong thing somehow. That would make the QOIX codec not lossless in 8-bit contrarily to today. |
Premultiplied alpha doesn't seem to strictly need ICC profile or full colorspace struct. We can still chug along, ignoring colorspace. |
Numbers for 3 real world overlays with low opacity, 8-bit sRGB
However there is no way to signal premul alpha in PNG in a way that is compatible, apart from doing the whole iphone transformation which is not trivial. Or maybe ICC can do it? |
This is breaking change, since decoders are now free to give premultiplied output.
|
Encoding rgba8 vs rgbap8 images. Without QOIX premul:
With QOIX premul:
|
QOIX lap8 vs la8 lap8
la8
this data set has no very transparent overlays though. |
QOIX rgba16 vs rgbap16
rgbap16
|
Available in v3.0.0 |
or
B. Decode unpremultiplied always, do not keep track of status, just provide ways to do it and undo it at the discretion of the user. This is simpler, but people will not get the advantages of premultiplied or less often.
Does premultiplied alpha encodes better, and how much better in terms of space? Check with PNG and QOIX. => YES, 2x better for some QOIX overlays!
Implement function to premultiply, or unpremultiply. This is the easy part, already exist in Dplug ImageKnob.
Big question is (above) whether to keep that information in the type system (PixelType) or not. This is NOT a LayoutOptions, and I don't think it should be a separate status also. Premultiplied alpha is better for compositing, but not for editing. It also looses a bit of data, but it repeatable.
The text was updated successfully, but these errors were encountered: