[Gimp-developer] Adapted and unadapted sRGB luminance values



I was curious as to why the Babl/Gegl/Gimp code uses the unadapted
sRGB luminance values rather than the adapted values.

Quoting Lindbloom
(http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html):

Since the ICC specification and Adobe Photoshop both use a reference
white of D50, the working space primaries that are specified relative
to some other reference white must first be adapted to D50 before they
may be used in a D50 environment, or be meaningfully compared with one
another.

If I understand him correctly, Poynton
(http://www.poynton.com/PDFs/ColorFAQ.pdf) was talking about the
conversion appropriate for sending signals to a monitor with a D65
white point.  Y709 = 0.2125 R + 0.7154 G + 0.0721B

Lindbloom unadapted and adapted sRGB "Y" values:
unadpapted sRGB R, G, B luminance (Y):  0.212656 0.715158 0.072186
adapted sRGB R, G, B luminance (Y):        0.222491 0.716888 0.060621

The sRGB profile created in
gegl/operations/external/lcms-from-profile.c has values very close to
the Lindbloom adapted values:  0.222488 0.716904 0.060608.

All the code in Babl/Gegl/Gimp that I could locate uses values very
close to the Lindbloom *un*adapted Y values:
./babl/babl/base/rgb-constants.h:  #define RGB_LUMINANCE_RED    (0.212671)
./babl/babl/base/rgb-constants.h:  #define RGB_LUMINANCE_GREEN  (0.715160)
./babl/babl/base/rgb-constants.h:  #define RGB_LUMINANCE_BLUE   (0.072169)
./gegl/operations/common/snn-mean.c:#define RGB_LUMINANCE_RED    (0.212671)
./gegl/operations/common/snn-mean.c:#define RGB_LUMINANCE_GREEN  (0.715160)
./gegl/operations/common/snn-mean.c:#define RGB_LUMINANCE_BLUE   (0.072169)
./gegl/operations/workshop/snn-percentile.c:#define RGB_LUMINANCE_RED
  (0.212671)
./gegl/operations/workshop/snn-percentile.c:#define
RGB_LUMINANCE_GREEN  (0.715160)
./gegl/operations/workshop/snn-percentile.c:#define RGB_LUMINANCE_BLUE
  (0.072169)
./gegl/opencl/colors.cl.h:"  #define RGB_LUMINANCE_RED    (0.212671f)
./gegl/opencl/colors.cl.h:"  #define RGB_LUMINANCE_GREEN  (0.715160f)
./gegl/opencl/colors.cl.h:"  #define RGB_LUMINANCE_BLUE   (0.072169f)
./gimp/libgimpcolor/gimprgb.h:#define GIMP_RGB_LUMINANCE_RED    (0.2126)
./gimp/libgimpcolor/gimprgb.h:#define GIMP_RGB_LUMINANCE_GREEN  (0.7152)
./gimp/libgimpcolor/gimprgb.h:#define GIMP_RGB_LUMINANCE_BLUE   (0.0722)
./babl/extensions/ycbcr.c:      luminance =  0.2126 * red + 0.7152 *
green + 0.0722 * blue;
./babl/extensions/ycbcr.c:      luminance =  0.2126 * red + 0.7152 *
green + 0.0722 * blue;
./gegl/operations/common/svg-saturate.c uses red:0.213 green:0.715 blue:0.072

Elle

-- 
http://ninedegreesbelow.com

Just because it's a standard, doesn't mean it's right.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]