gecko-dev/image/test
Timothy Nikkel 2a8ea92054 Bug 1846055. Fix color management of grayscale avif files. r=gfx-reviewers,lsalzman
Color management is usually handled in the SurfacePipe, but SurfacePipe is RGB(A) only, and qcms can only operator on grayscale images in grayscale format, not RGB(A). So we must handle the qcms operation in the decoder. This is the same as how the png decoder handles this same situation. One additional wrinkle is that gfx::ConvertYCbCrToRGB32 only outputs RGB even for grayscale input data so we have to create an intermediate grayscale copy of the data for qcms to work on.

Recording command lines here that were used to create the test in case it needs to be modified or extended in the future.

Convert png to grayscale or grayscale + alpha

ffmpeg -i file.png -pix_fmt gray file-gray.png
ffmpeg -i file.png -pix_fmt ya8 file-gray.png

Extract icc profile from png

exiftool -icc_profile -b -w icc file.png

Add icc profile to png

exiftool "-icc_profile<=profile.icc" file.png

Encode avif using provided icc profile in file

avifenc --icc profile.icc input.png output.avif

Differential Revision: https://phabricator.services.mozilla.com/D220101
2024-09-09 09:39:12 +00:00
..
browser Bug 1910297. Handle repaint propagation to the root if the root is a table. r=layout-reviewers,emilio 2024-08-09 10:25:21 +00:00
crashtests Bug 1910211. Error-out if an avif file specifies color space options that are not supported instead of asserting. r=gfx-reviewers,nical 2024-08-07 12:33:34 +00:00
fuzzing Bug 1892285 - Use correct method when setting image.mem.max_legal_imgframe_size_kb pref. r=tsmith 2024-04-18 17:35:12 +00:00
gtest Bug 1901076 - Part 2. Expose frame count variant of metadata decoders. r=tnikkel 2024-06-24 22:44:30 +00:00
mochitest Bug 1910297. Handle repaint propagation to the root if the root is a table. r=layout-reviewers,emilio 2024-08-09 10:25:21 +00:00
reftest Bug 1846055. Fix color management of grayscale avif files. r=gfx-reviewers,lsalzman 2024-09-09 09:39:12 +00:00
unit Bug 1864896: Autofix unused function arguments (image). r=tnikkel 2024-03-03 09:09:10 +00:00
animated_image_test_list.js Bug 1910297. Handle repaint propagation to the root if the root is a table. r=layout-reviewers,emilio 2024-08-09 10:25:21 +00:00