-
Notifications
You must be signed in to change notification settings - Fork 195
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
Premultiplied alpha support #292
Comments
So from a libavif perspective, am I understanding the support request correctly (after reading the standard):
Is this sufficient for libavif support? Obviously downstream projects will have to honor the boolean independently of libavif. |
Hmmm… I understood the spec differently. The alpha association remains exactly as-is, nothing changes there. And there in addition to image<>auxl assocation, there exists a reverse association of type And if the boolean is true, then multiply by alpha when encoding, divide by alpha when decoding. |
@cconcolato Can you provide guidance on how the actual boxes should be structured for I'd prefer to not actually offer pixel manipulation in |
It would be very useful to have an option to accept and return premultiplied alpha data unchanged. Premultiplied alpha is the "native" format on macOS and iOS. If you don't want to do conversions, that's a bit unfortunate. I don't see this colorspace conversion much different than all the other conversions the library needs to do. If you don't want to perform the conversion, please keep |
In your mind, how would this correctly interact with YUV<->RGB conversion? I'm concerned that this will turn into a huge can of worms, and I haven't fit the issue entirely in my head yet. @bnason-nf Do you have opinions on these mechanisms? |
AFAIK you can't apply it to YUV, so in I would expect If the If the macOS apps could be expected to always ask for premultiplied. Apps that convert to PNG could be expected to always ask for uncorrelated. Technically it'd be similar to |
I agree with that. |
FYI, there's support for premultiplied alpha now in Firefox nightly and should be part of the next release (86) when AVIF support will be enabled by default |
I think this is worth tracking still, for sure. I can make a new issue if you'd prefer to not be involved, however. Let me know. |
I just accepted PR #477, which should add support for this. |
Efficient compression of images with alpha benefits from using premultiplied alpha color space.
In AVIF that is marked by
iref
box withprem
type: AOMediaCodec/av1-avif#96 (comment)I'm attaching a test case. Both images in the zip file should look the same. If the
premultiplied.avif
looks darker, it's a bug.prem-test-case.zip
image attribution: wikipedia
The text was updated successfully, but these errors were encountered: