#9673: ffmpeg not reading color information from JPEG ICC profile
-------------------------------------+-------------------------------------
Reporter: Cosmin | Owner: haasn
Stejerean |
Type: defect | Status: closed
Priority: normal | Component:
| undetermined
Version: unspecified | Resolution: fixed
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by haasn):
So, I wrote a small demo utility to run the `ffprobe` logic on a variety
of ICC files on my system, here are my results:
=== ArgyllCMS ICC profiles (v2)
- ACES_P3.icm: unknown profile:
Red: XYZ 2.1249 1.0 0.0000, Yxy 0.680 0.320
Green: XYZ 0.3841 1.0 0.0652, Yxy 0.265 0.690
Blue: XYZ 2.5000 1.0 13.1669, Yxy 0.150 0.060
White: XYZ 0.9527 1.0 1.0088, Yxy 0.3216819 0.3376689
- ClayRGB1998.icm: detected primaries: Adobe RGB (1998)
- icctest: icctest.c:38: dump_prim: Assertion `tf' failed.
- DisplayP3.icm: detected primaries: DCI-P3 (Digital Cinema) with D65
white point
- EBU3213_PAL.icm: detected primaries: ITU-R Rec. BT.601 (625-line = PAL,
SECAM)
- icctest: icctest.c:38: dump_prim: Assertion `tf' failed.
- ProPhoto.icm: detected primaries: ProPhoto RGB (ROMM)
- ProPhotoLin.icm: detected primaries: ProPhoto RGB (ROMM)
- Rec2020.icm: detected primaries: ITU-R Rec. BT.2020 (UltraHD)
- Rec709.icm: detected primaries: ITU-R Rec. BT.709 (HD), also sRGB
- SMPTE431_P3.icm: detected primaries: DCI-P3 (Digital Cinema)
- SMPTE_RP145_NTSC.icm: detected primaries: ITU-R Rec. BT.601 (525-line =
NTSC, SMPTE-C)
- sRGB.icm: detected primaries: ITU-R Rec. BT.709 (HD), also sRGB
The ACES P3 profile exactly matches the values we'd expect from a profile
combining the DCI-P3 gamut with the ACES whitepoint.
=== krita ICC profiles (mix)
- ACEScg-elle-V4-g10.icc: detected primaries: ACES Primaries #1
- ClayRGB-elle-V2-g22.icc: detected primaries: Adobe RGB (1998)
- ClayRGB-elle-V4-srgbtrc.icc: detected primaries: Adobe RGB (1998)
- krita25_lcms-builtin-sRGB_g100-truegamma.icc: detected primaries: ITU-R
Rec. BT.709 (HD), also sRGB
- LargeRGB-elle-V2-g22.icc: detected primaries: ProPhoto RGB (ROMM)
- Rec2020-elle-V4-g10.icc: detected primaries: ITU-R Rec. BT.2020
(UltraHD)
- sRGB-elle-V2-g10.icc: detected primaries: ITU-R Rec. BT.709 (HD), also
sRGB
- sRGB-elle-V2-srgbtrc.icc: detected primaries: ITU-R Rec. BT.709 (HD),
also sRGB
- WideRGB-elle-V2-g22.icc: unknown profile:
Red: XYZ 2.7693 1.0 -0.0000, Yxy 0.735 0.265
Green: XYZ 0.1394 1.0 0.0707, Yxy 0.115 0.826
Blue: XYZ 8.8554 1.0 46.6897, Yxy 0.157 0.018
White: XYZ 0.9642 1.0 0.8249, Yxy 0.3457029 0.3585375
Again, all profiles are correctly recognized except for WideRGB which
seems to be some custom profile with D65 white point.
=== colord profiles (v4)
- AdobeRGB1998.icc: detected primaries: Adobe RGB (1998)
- AppleRGB.icc: unknown profile:
Red: XYZ 1.8383 1.0 0.1030, Yxy 0.625 0.340
Green: XYZ 0.4706 1.0 0.2101, Yxy 0.280 0.595
Blue: XYZ 2.2144 1.0 11.0724, Yxy 0.155 0.070
White: XYZ 0.9502 1.0 1.0883, Yxy 0.3127148 0.3291147
- NTSC-RGB.icc: detected primaries: ITU-R Rec. BT.470 M
- PAL-RGB.icc: detected primaries: ITU-R Rec. BT.601 (625-line = PAL,
SECAM)
- ProPhotoRGB.icc: detected primaries: ProPhoto RGB (ROMM)
- Rec709.icc: detected primaries: ITU-R Rec. BT.709 (HD), also sRGB
- SMPTE-C-RGB.icc: detected primaries: ITU-R Rec. BT.601 (525-line = NTSC,
SMPTE-C)
- sRGB.icc: detected primaries: ITU-R Rec. BT.709 (HD), also sRGB
(I omitted some results corresponding to synthetic/test/obscure profiles)
=== https://webkit.org/blog-files/color-gamut/
- Flowers-ProPhoto.icc: detected primaries: ProPhoto RGB (ROMM)
- Flowers-sRGB.icc: detected primaries: ITU-R Rec. BT.709 (HD), also sRGB
- Iceland-P3.icc: unknown profile:
Red: XYZ 2.0947 1.0 -0.0001, Yxy 0.677 0.323
Green: XYZ 0.3786 1.0 0.0861, Yxy 0.258 0.683
Blue: XYZ 2.4646 1.0 17.3858, Yxy 0.118 0.048
White: XYZ 0.9369 1.0 1.4378, Yxy 0.2776273 0.2963247
- Italy-P3.icc: unknown profile:
Red: XYZ 2.0947 1.0 -0.0001, Yxy 0.677 0.323
Green: XYZ 0.3786 1.0 0.0861, Yxy 0.258 0.683
Blue: XYZ 2.4646 1.0 17.3858, Yxy 0.118 0.048
White: XYZ 0.9369 1.0 1.4378, Yxy 0.2776273 0.2963247
- Rose-AdobeRGB.icc: detected primaries: Adobe RGB (1998)
- Rose-ProPhoto.icc: detected primaries: ProPhoto RGB (ROMM)
- Rose-sRGB.icc: detected primaries: ITU-R Rec. BT.709 (HD), also sRGB
- Shoes-AdobeRGB.icc: detected primaries: Adobe RGB (1998)
- Sunset-P3.icc: unknown profile:
Red: XYZ 2.0947 1.0 -0.0001, Yxy 0.677 0.323
Green: XYZ 0.3786 1.0 0.0861, Yxy 0.258 0.683
Blue: XYZ 2.4646 1.0 17.3858, Yxy 0.118 0.048
White: XYZ 0.9369 1.0 1.4378, Yxy 0.2776273 0.2963247
- YellowFlower-P3.icc: unknown profile:
Red: XYZ 2.0947 1.0 -0.0001, Yxy 0.677 0.323
Green: XYZ 0.3786 1.0 0.0861, Yxy 0.258 0.683
Blue: XYZ 2.4646 1.0 17.3858, Yxy 0.118 0.048
White: XYZ 0.9369 1.0 1.4378, Yxy 0.2776273 0.2963247
All ICC profiles were extracted from the correspondingly named test
images. (Note that the sRGB images do not have an attached color profile)
=== color.org
- DCI-P3-D65.icc: detected primaries: DCI-P3 (Digital Cinema) with D65
white point
- DCI-P3-DCI.icc: detected primaries: DCI-P3 (Digital Cinema)
- ITU-RBT709ReferenceDisplay.icc: detected primaries: ITU-R Rec. BT.709
(HD), also sRGB
- sRGB2014.icc: detected primaries: ITU-R Rec. BT.709 (HD), also sRGB
=== http://color.support/iccprofiles.html
- P3D60.icc: unknown profile:
Red: XYZ 2.1249 1.0 0.0000, Yxy 0.680 0.320
Green: XYZ 0.3841 1.0 0.0652, Yxy 0.265 0.690
Blue: XYZ 2.4999 1.0 13.1664, Yxy 0.150 0.060
White: XYZ 0.9526 1.0 1.0088, Yxy 0.3216771 0.3376677
- P3D65.icc: detected primaries: DCI-P3 (Digital Cinema) with D65 white
point
- P3DCI.icc: detected primaries: DCI-P3 (Digital Cinema)
- Rec2020-Rec1886.icc: detected primaries: ITU-R Rec. BT.2020 (UltraHD)
- Rec709-Rec1886.icc: detected primaries: ITU-R Rec. BT.709 (HD), also
sRGB
=== https://github.com/saucecontrol/Compact-ICC-Profiles
- AdobeCompat-v2.icc: detected primaries: Adobe RGB (1998)
- AdobeCompat-v4.icc: detected primaries: Adobe RGB (1998)
- DCI-P3-v4.icc: detected primaries: DCI-P3 (Digital Cinema)
- DisplayP3Compat-v2-magic.icc: unknown profile:
Red: XYZ 2.1250 1.0 0.0061, Yxy 0.679 0.319
Green: XYZ 0.3841 1.0 0.0651, Yxy 0.265 0.690
Blue: XYZ 2.5001 1.0 13.1548, Yxy 0.150 0.060
White: XYZ 0.9505 1.0 1.0891, Yxy 0.3127005 0.3289998
- DisplayP3Compat-v2-micro.icc: unknown profile:
Red: XYZ 2.1250 1.0 0.0061, Yxy 0.679 0.319
Green: XYZ 0.3841 1.0 0.0651, Yxy 0.265 0.690
Blue: XYZ 2.5001 1.0 13.1548, Yxy 0.150 0.060
White: XYZ 0.9505 1.0 1.0891, Yxy 0.3127005 0.3289998
- DisplayP3Compat-v4.icc: detected primaries: DCI-P3 (Digital Cinema) with
D65 white point
- DisplayP3-v2-magic.icc: detected primaries: DCI-P3 (Digital Cinema) with
D65 white point
- DisplayP3-v2-micro.icc: detected primaries: DCI-P3 (Digital Cinema) with
D65 white point
- DisplayP3-v4.icc: detected primaries: DCI-P3 (Digital Cinema) with D65
white point
- ProPhoto-v2-magic.icc: detected primaries: ProPhoto RGB (ROMM)
- ProPhoto-v2-micro.icc: detected primaries: ProPhoto RGB (ROMM)
- ProPhoto-v4.icc: detected primaries: ProPhoto RGB (ROMM)
- Rec2020Compat-v2-magic.icc: unknown profile:
Red: XYZ 2.4246 1.0 0.0098, Yxy 0.706 0.291
Green: XYZ 0.2133 1.0 0.0413, Yxy 0.170 0.797
Blue: XYZ 2.8479 1.0 17.8628, Yxy 0.131 0.046
White: XYZ 0.9505 1.0 1.0891, Yxy 0.3127005 0.3289998
- Rec2020Compat-v2-micro.icc: unknown profile:
Red: XYZ 2.4246 1.0 0.0098, Yxy 0.706 0.291
Green: XYZ 0.2133 1.0 0.0413, Yxy 0.170 0.797
Blue: XYZ 2.8479 1.0 17.8628, Yxy 0.131 0.046
White: XYZ 0.9505 1.0 1.0891, Yxy 0.3127005 0.3289998
- Rec2020Compat-v4.icc: detected primaries: ITU-R Rec. BT.2020 (UltraHD)
- Rec2020-g24-v4.icc: detected primaries: ITU-R Rec. BT.2020 (UltraHD)
- Rec2020-v2-magic.icc: detected primaries: ITU-R Rec. BT.2020 (UltraHD)
- Rec2020-v2-micro.icc: detected primaries: ITU-R Rec. BT.2020 (UltraHD)
- Rec2020-v4.icc: detected primaries: ITU-R Rec. BT.2020 (UltraHD)
- Rec601NTSC-v2-magic.icc: detected primaries: ITU-R Rec. BT.601 (525-line
= NTSC, SMPTE-C)
- Rec601NTSC-v2-micro.icc: detected primaries: ITU-R Rec. BT.601 (525-line
= NTSC, SMPTE-C)
- Rec601NTSC-v4.icc: detected primaries: ITU-R Rec. BT.601 (525-line =
NTSC, SMPTE-C)
- Rec601PAL-v2-magic.icc: detected primaries: ITU-R Rec. BT.601 (625-line
= PAL, SECAM)
- Rec601PAL-v2-micro.icc: detected primaries: ITU-R Rec. BT.601 (625-line
= PAL, SECAM)
- Rec601PAL-v4.icc: detected primaries: ITU-R Rec. BT.601 (625-line = PAL,
SECAM)
- Rec709-v2-magic.icc: detected primaries: ITU-R Rec. BT.709 (HD), also
sRGB
- Rec709-v2-micro.icc: detected primaries: ITU-R Rec. BT.709 (HD), also
sRGB
- Rec709-v4.icc: detected primaries: ITU-R Rec. BT.709 (HD), also sRGB
- scRGB-v2.icc: detected primaries: ITU-R Rec. BT.709 (HD), also sRGB
- sRGB-v2-magic.icc: detected primaries: ITU-R Rec. BT.709 (HD), also sRGB
- sRGB-v2-micro.icc: detected primaries: ITU-R Rec. BT.709 (HD), also sRGB
- sRGB-v2-nano.icc: detected primaries: ITU-R Rec. BT.709 (HD), also sRGB
- sRGB-v4.icc: detected primaries: ITU-R Rec. BT.709 (HD), also sRGB
I removed some less interesting profiles. All of the profiles were
correctly detected, with the notable exception of the "Compat" v2
profiles, which the README advises use modified primaries (seems they
reduced red primary x/y by ~0.001). That explains why we don't detect them
as DCI-P3, even though the detected values are very close.
=== Conclusion
In conclusion, basically all of the profiles tested above work, except for
the ones that don't have corresponding names/enums, including the *other*
ICC profiles from the webkit demo page. This includes v2 profiles, v4
profiles, profiles with white points other than D65, wide gamut profiles,
standard gamut profiles, and so on. Notably, the DCI-P3 profile I
downloaded from color.org, an authoritative source if there ever was one,
is detected correctly: https://www.color.org/chardata/rgb/DCIP3.xalter
So in summary, the overwhelming evidence appears to indicate that the code
is correct, and the ICC profile extracted from that test page is faulty. I
would recommend using one of the other DCI-P3 ICC profiles from the above
links, as a replacement, all of which are detected correctly.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9673#comment:17>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac
To unsubscribe, visit link above, or email
ffmpeg-trac-requ...@ffmpeg.org with subject "unsubscribe".