[FFmpeg-trac] #3643(swscale:new): XYZ to RGB color space

FFmpeg trac at avcodec.org
Sat May 17 15:41:48 CEST 2014


#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


More information about the FFmpeg-trac mailing list