Support transparency in JPEG-XL #2040

Closed
opened 6 months ago by Moonchild · 7 comments
Owner

What it says on the tin. We have transparency layer support but don't seem to handle it correctly. Possibly an issue with alpha premultiplication?
We may need to look at how we do this for our PNG support.

What it says on the tin. We have transparency layer support but don't seem to handle it correctly. Possibly an issue with alpha premultiplication? We may need to look at how we do this for our PNG support.
Moonchild added a new dependency 6 months ago

Firefox and Palemoon both show the 3 colors on the following test page:
https://asozial.org/.well-known/transparency.html

The image should be fully transparent, but Firefox and Palemoon seem to ignore that if there are color values set.

Firefox and Palemoon both show the 3 colors on the following test page: https://asozial.org/.well-known/transparency.html The image should be fully transparent, but Firefox and Palemoon seem to ignore that if there are color values set.
Poster
Owner

https://jpegxl.info/test-page/

We already have transparency support in the surface; the only problem is that our rendering pipe for it expects premultiplied alpha. I can slot this in easily enough along with the RB channel swapping we're doing.

(I still strongly disagree with alpha premultiplication practice. It is literally losing color data; see also our non-premul gradients vs. premul gradients in other browsers; test here)

https://jpegxl.info/test-page/ We already have transparency support in the surface; the only problem is that our rendering pipe for it expects premultiplied alpha. I can slot this in easily enough along with the RB channel swapping we're doing. (I still strongly disagree with alpha premultiplication practice. It is literally losing color data; see also our non-premul gradients vs. premul gradients in other browsers; test [here](http://testserver.palemoon.org/gradients/gradient-transparent-test.html))
Moonchild self-assigned this 6 months ago
Moonchild added this to the 32.0.0 milestone 6 months ago
Poster
Owner

Some fast integer math did the trick!

Some fast integer math did the trick!
Moonchild added the
Images
Fixed
Verified
labels 6 months ago
Moonchild closed this issue 6 months ago

Can we uplift this for 31.4.2? The workaround does seem to work properly and I doubt it will break anything. Transparency is a pretty important feature as JPEG-XL is supposed to replace PNG too, and IMO it wouldn't be a good look both for Pale Moon and JPEG-XL if users see that their converted PNGs which have an alpha channel don't look right in the browser.

Can we uplift this for 31.4.2? The workaround does seem to work properly and I doubt it will break anything. Transparency is a pretty important feature as JPEG-XL is supposed to replace PNG too, and IMO it wouldn't be a good look both for Pale Moon and JPEG-XL if users see that their converted PNGs which have an alpha channel don't look right in the browser.
Poster
Owner

Yeah I planned to cherry pick this for the sec release before the holidays. I just didn't get around to marking it on the repo yet (and I'll be travelling the next 4 days so won't be around). I'll mark it here with the appropriate label and milestone to make sure I don't forget.

Yeah I planned to cherry pick this for the sec release before the holidays. I just didn't get around to marking it on the repo yet (and I'll be travelling the next 4 days so won't be around). I'll mark it here with the appropriate label and milestone to make sure I don't forget.
Moonchild added the
Release Uplift Wanted
label 6 months ago
Moonchild modified the milestone from 32.0.0 to 31.4.2 6 months ago
Poster
Owner

reopen for uplift

reopen for uplift
Moonchild reopened this issue 6 months ago
Poster
Owner

Uplifted in [49a86db5f3]

Uplifted in [49a86db5f3]
Moonchild closed this issue 5 months ago
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Blocks
#2039 Expand JPEG-XL support
MoonchildProductions/UXP
Reference: MoonchildProductions/UXP#2040
Loading…
There is no content yet.