[wp-trac] [WordPress Trac] #62285: HDR AVIF is corrupt in the media library (encoded as SDR)
WordPress Trac
noreply at wordpress.org
Tue Oct 22 20:23:38 UTC 2024
#62285: HDR AVIF is corrupt in the media library (encoded as SDR)
--------------------------+-----------------------------
Reporter: gregbenz | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
When a 10-bit HDR AVIF image is uploaded to the WP media library, it gets
transcoded to 8-bit with an SDR EOTF. The result is the image is unusable
as it is significantly degraded from the original (the change in EOTF here
results in invalid interpretation of the pixel values, and the degradation
from 10 to 8-bit creates significant risk of banding for an HDR image).
expected result: the following EXIFTOOL command should show the same
values for both source and the newly transcoded image when the source is
HDR (ie has a PQ or HLG transfer function):
{{{
exiftool -imagepixeldepth -transfercharacteristics myFile.JPG
}}}
Note that the following test with ImageMagick 7.1.1-39 Q16-HDRI aarch64
22428 produced a valid output. (I tested WP with a slightly different
version in my hosting environment: ImageMagick 7.1.1-38 Q16-HDRI x86_64
22398). Test command for local instance of IM:
{{{
magick sourceHDR.avif -resize 50% transcodedHDR.avif
}}}
The concern here is specific to HDR images. If the image is SDR, then
converting 10-bit to 8-bit output would typically be a reasonable way to
compress the image (the risk of banding is much lower for an SDR image).
So the optimal result would be:
- keep the original EOTF for all images
- keep the original bit depth if HDR, but allow conversion to 8-bit if the
the image is SDR.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62285>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list