Skip to content

Add ability to signal alpha channel type? #1028

@haasn

Description

@haasn

In the wild, there is a significant disagreement about whether images containing alpha channels should be "premultiplied" or "straight / independent" alpha. Some codes specify this as part of their specifications (notably, PNG); while some others have tagging for it (e.g. JPEG-XL). This can cause intense headaches when transcoding between formats, especially when using raw or lossless intermediate formats that generally don't tag/preserve the alpha mode. It would be nice to have ability to tag the correct alpha mode on the container level in Matroska.

I saw that there already exists an "AlphaMode" tag, but that it is advised in practice to avoid using undefined values due to differing behavior between firefox and chromium.

Do you think we could extend this defininition to introduce the value of 2 = Premultiplied alpha, and retroactively redefine 1 = Straight / independent alpha? In implementations that ignore the values > 1, it will be treated as implicitly blended to black. So the main problem comes with browsers that would then start interpreting these (premultiplied) files as straight alpha, leading to incorrect compositing.

Or maybe it's better to introduce some sort of new tag?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions