[FFmpeg-trac] #9085(undetermined:new): JPEG: YCCK and PhotoYCC support
FFmpeg
trac at avcodec.org
Fri Jan 29 19:50:48 EET 2021
#9085: JPEG: YCCK and PhotoYCC support
-------------------------------------+-------------------------------------
Reporter: Balling | Type: defect
Status: new | Priority: normal
Component: | Version: git-
undetermined | master
Keywords: pcd, j2k, | Blocked By:
jpeg |
Blocking: | Reproduced by developer: 1
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
There are two color spaces that are not supported in JPEG currently, YCCK
and, as used in Photo CD (see #5923), PhotoYCC. YCCK is (as said in
https://web.archive.org/web/20170720100717/http://halicery.com/Image/jpeg/JPEGCMYK.html)
YCC --> CMY and then K is added. Also there is this sample:
https://bugs.chromium.org/p/chromium/issues/detail?id=1115101 (chromium
does support it but not icc profiles).
Implementation: https://github.com/mozilla/mozjpeg/search?q=YCCK
Note: as said in above link K can be inverted.
Now with PhotoYCC it is a little more complicated. But I fully described
it on Wikipedia, fixing the incorrect transfer function (it is the same as
in xvYCC format that is IN ffmpeg). The matrix is from BT.601 but without
scaling, so 1.402 (2 * (1 - K_r)) and 1.772 (2 * (1 - K_b)) are not
applied. Also quantization is different. All is here:
https://en.wikipedia.org/wiki/Photo_CD#Encoding
The implementation is also here
https://github.com/DavidGriffith/finx/blob/17825bf28b2351f96867b34a7dc39f7997e2f9ff/nx-X11/programs/Xserver/XIE/mixie/process/mprgb.c#L1004
JPEG 2000 also supports both of them (EnumCS 13 and 9).
This produces very green picture:
{{{
% ffplay Channel_digital_image_CMYK_color.jpg
}}}
I believe this is a defect, as it is part of the jpeg decoder...
Patches should be submitted to the ffmpeg-devel mailing list and not this
bug tracker.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9085>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list