[wp-trac] [WordPress Trac] #62285: HDR AVIF is corrupt in the media library (encoded as SDR)
WordPress Trac
noreply at wordpress.org
Sun Dec 1 04:35:55 UTC 2024
#62285: HDR AVIF is corrupt in the media library (encoded as SDR)
--------------------------+------------------------------
Reporter: gregbenz | Owner: adamsilverstein
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.8
Component: Media | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by gregbenz):
@adamsilverstein I believe the simplest approach would be to stay at the
same bit depth, up to a maximum of 12. This would ensure retention of
suitable quality without penalty if the original is encoded in an
appropriate bit depth.
If your assumption is that many people will create originals with higher
bit depth than necessary and you wish to prioritize small file size, you
could take a more complex approach - at the risk of some edge cases where
unwanted banding is created. For example, you could use 8-bits for SDR
EOTFs and 10-bit for HDR EOTFs. That’s fairly crude, but probably safe for
99% of images. If a way for a user to select higher quality could be
offered, that could be a good choice.
Ultimately, the benefit for higher bit depths (SDr at 10, HDR at 12) would
mostly likely show when there is a smooth gradient across a sufficient
tonal range. 10-bit encoding does generally work well for HDR capabilities
we have today, 12-bit is probably more of a consideration for future
proofing.
I’m not aware of an efficient way to assess that in code, and I would
recommend keeping source depth or perhaps using the 10-bit HDR with a user
option to go higher if needed.
As far as file size impact, I don’t have data on it. I expect that 12-bit
encoding will rarely be used where not necessary, so probably minimal
impact in real use. Compression may impact the results, but you might
estimate 20% bloat if 12-bit were needlessly used in the source (ie missed
opportunity to improve). I would err on the side of assuming that if the
image was exported at 12-bit that it is more likely beneficial and
squeezing to 10 risks banding.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62285#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list