#3643(undetermined:new): XYZ to RGB color space
#3643: XYZ to RGB color space -------------------------------------+------------------------------------- Reporter: tteam | Type: Status: new | enhancement Component: | Priority: normal undetermined | Version: Keywords: more XYZ to | unspecified RGB matrix | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Summary of the bug: XYZ to RGB colorspace conversion use only sRGB matrix and sometimes the conversion is deffected in red channel and the picture is dark. Hi all! Is it possible to add more color space matrix (in option) to XYZ to RGB conversion? Because the FFMPEG use only one matrix (sRGB) but lots of available, and best if the user can choose one. Because the problem is: sometimes the conversion is deffected the red is much more and the picture is dark. If possible please add some from this list. The default is the sRGB but optional the others. XYZ to RGB matrices: http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html Thanks -- Ticket URL: <https://trac.ffmpeg.org/ticket/3643> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#3643: XYZ to RGB color space -------------------------------------+----------------------------------- Reporter: tteam | Owner: Type: enhancement | Status: new Priority: normal | Component: swscale Version: git-master | Resolution: Keywords: xyz | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Changes (by cehoyos): * keywords: more XYZ to RGB matrix => xyz * version: unspecified => git-master * component: undetermined => swscale Comment: Replying to [ticket:3643 tteam]:
sometimes the conversion is deffected in red channel and the picture is dark.
Please provide an example to make this a valid ticket: Upload a sample input file and post your command line (the one that makes the picture dark) together with the complete, uncut console output. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3643#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#3643: XYZ to RGB color space -------------------------------------+----------------------------------- Reporter: tteam | Owner: Type: enhancement | Status: new Priority: normal | Component: swscale Version: git-master | Resolution: Keywords: xyz | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Comment (by tteam): ffmpeg version N-62259-gb176320 Copyright (c) 2000-2014 the FFmpeg developers built on Apr 7 2014 22:08:51 with gcc 4.8.2 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable- libfreetyp e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable- libvo-aa cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable- libwavp ack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable -zlib libavutil 52. 74.100 / 52. 74.100 libavcodec 55. 58.102 / 55. 58.102 libavformat 55. 36.102 / 55. 36.102 libavdevice 55. 11.100 / 55. 11.100 libavfilter 4. 3.100 / 4. 3.100 libswscale 2. 6.100 / 2. 6.100 libswresample 0. 18.100 / 0. 18.100 libpostproc 52. 3.100 / 52. 3.100 command: ffmpeg -i trailer.mxf -vcodec prores -profile:v 3 trailer.mov ffmpeg -i j2c000047.j2c rgb_out.tif here is the sample download link: http://we.tl/eiE5MkoGeY Now I attach the original XYZ picture the imagemagik converted what output result is OK and the FFMPEG result. When I see this problem is generated by the matrix and/or linearization. here is the UTAH university test: http://www.cs.utah.edu/~halzahaw/CS7650/Project2/project2_index.html They opinion with the Bruce Lindbloom matrix: "The images seemed to have more of a red hue which I'm not able to explain. Also it was interesting that the bottom-right most square which is supposed to be the black square actually appears to be dark grey. I tried different values of gamma but it always turns out grey or if it does seem black then all the other colored squares are affected in turn." For good output result Utah use a generic XYZ to RGB matrix with gamma: 0.4. here is: r = 2.5623 * x + (-1.1661) * y + (-0.3962) * z g = (-1.0215) * x + 1.9778 * y + 0.0437 * z b = 0.0752 * x + (-0.2562) * y + 1.1810 * z this matrix is really close to COLORMATCH RGB matrix ;) and here is a other matrix (XML part from easydcp) and this result is ok too this output is same like imagemagik. - <transformation name="X'Y'Z' -> Linear RGB" comment="comment line"> <source color_space="X'Y'Z'" primaries="XYZ" white_point="" gamma="0.3846154" white_projector_luminance="48.0" normalizing_constant="52.37" normalizing_bitrate="12" /> <destination color_space="Linear RGB" primaries="RGB" white_point="" gamma="2.2" /> - <matrix> <row>3.24096989631653;-1.5373831987381;-0.498610764741898</row> <row>-0.96924364566803;1.87596750259399;0.0415550582110882</row> <row>0.0556300804018974;-0.203976958990097;1.05697154998779</row> So if its possible please add to the XYZ to RGB conversion more matrix and input - output gamma adjust options. Thanks :) -- Ticket URL: <https://trac.ffmpeg.org/ticket/3643#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#3643: XYZ to RGB color space -------------------------------------+----------------------------------- Reporter: tteam | Owner: Type: enhancement | Status: new Priority: normal | Component: swscale Version: git-master | Resolution: Keywords: xyz | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Comment (by richardpl): The XYZ sample is gone. -- Ticket URL: <https://trac.ffmpeg.org/ticket/3643#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#3643: XYZ to RGB color space -------------------------------------+----------------------------------- Reporter: tteam | Owner: Type: enhancement | Status: new Priority: normal | Component: swscale Version: git-master | Resolution: Keywords: xyz | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Changes (by cehoyos): * cc: richardpl (added) Comment: One XYZ sample is attached to ticket #4827. I just uploaded the original zip to http://samples.ffmpeg.org/ffmpeg- bugs/trac/ticket3643/ -- Ticket URL: <https://trac.ffmpeg.org/ticket/3643#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#3643: XYZ to RGB color space -------------------------------------+----------------------------------- Reporter: tteam | Owner: Type: enhancement | Status: open Priority: normal | Component: swscale Version: git-master | Resolution: Keywords: xyz | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Changes (by Balling): * status: new => open Comment: Replying to [comment:4 cehoyos]:
One XYZ sample is attached to ticket #4827.
~~I just uploaded the original zip to http://samples.ffmpeg.org/ffmpeg- bugs/trac/ticket3643/
That XYZ sample is frm_000127.j2c from that zip archive from samples.ffmpeg.org. BTW, where is original trailer.mxf? -- Ticket URL: <https://trac.ffmpeg.org/ticket/3643#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#3643: XYZ to RGB color space -------------------------------------+----------------------------------- Reporter: TTeam | Owner: (none) Type: enhancement | Status: open Priority: normal | Component: swscale Version: git-master | Resolution: Keywords: xyz | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Comment (by Balling): Related https://patchwork.ffmpeg.org/project/ffmpeg/patch/20241216112118.424999-8-ff... I do not understand this patch at all, Haasn. It is correct to tag it as SMPTE primaries, those are fake primaries (centre white), they are not used ''as XYZ HAS NO primaries''.
XYZ to RGB colorspace conversion use only sRGB matrix
It is correct for typical HD video, that has BT.709 primaries, you must use BT.709 primaries XYZ matrix as specified in Nvidia docs or here: https://en.wikipedia.org/wiki/SRGB#Correspondence_to_CIE_XYZ_stimulus (The 2003 amended version of the sRGB standard points out that higher accuracy is needed when the samples are encoded with more than 8 bits. **It provides the matrix**), the primaries in BT.2020 will have to be converted to BT.709 or different XYZ matrix will have to be used. If **I do not understand something** please tell me so (what does it mean in your patch "possibly simply by using a more fitting RGB intermediate like SMPTE428"), also see page 7 of https://5253154.fs1 .hubspotusercontent-na1.net/hubfs/5253154/st2067-40-2021.pdf Also this is how you get YCbCr two cofficients from primaries, as such: https://imgur.com/a/i6742tj -- Ticket URL: <https://trac.ffmpeg.org/ticket/3643#comment:6> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#3643: XYZ to RGB color space -------------------------------------+----------------------------------- Reporter: TTeam | Owner: (none) Type: enhancement | Status: open Priority: normal | Component: swscale Version: git-master | Resolution: Keywords: xyz | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Comment (by Balling): Yes... https://github.com/kasper93/mpv/commit/ad47e72dade90d338c3d8d9c2a0e50ba4e7bb... #diff-900f486e23d6165c9e00afffe78d3fdeb6012a4300f38f0f48ba0e81cfc52174R638 -- Ticket URL: <https://trac.ffmpeg.org/ticket/3643#comment:7> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#3643: XYZ to RGB color space -------------------------------------+----------------------------------- Reporter: TTeam | Owner: (none) Type: enhancement | Status: open Priority: normal | Component: swscale Version: git-master | Resolution: Keywords: xyz | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Comment (by Balling): Additional fixes for XYZ 54c865fbec6f5914b0c041bff8c15b63b14964f1 -- Ticket URL: <https://trac.ffmpeg.org/ticket/3643#comment:8> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg