3

I am testing some color scheme libraries and do not know what is limits of some color schemes.

For example:

  • RGB(r, g, b) - all values is between <0.0, 1.0>
  • IRGB(r, g, b) - all values is between <0, 255>

What is limits for CIE color schemes:

  • XYZ(x, y, z)
  • Lab(L, a, b)
  • Luv(L, u, v)
  • LCHab(L, a, b) or LCHab(L, c, h)
  • LCHuv(L, u, v) or LCHuv(L, c, h)
Chameleon
  • 9,722
  • 16
  • 65
  • 127

4 Answers4

2

The functions from RGB to XYZ to LUV to HCL, etc, is monotone for some spaces but not for others, notably V and H (among the ones I tried). Because I needed it, and wanted to be sure, I calculated the minima and maxima values through exhaustive search of the RGB triples and came across the following values. (I only tried XYZ, LUV and HCL.) Here are the minima in the top row and maxima in the second row.

      X    Y       Z     L       U             V        H         C
  0.000    0    0.000    0   -83.07753  -134.1030   1.3e-05     0.0000
 95.047  100  108.883  100   175.01505   107.3985   360.0     179.041

I hope that this is helpful to the original questioner even though clearly way late.

user3236841
  • 1,088
  • 1
  • 15
  • 39
  • However, note that these values could change with a different implementation, etc. For example, some libraries stretch the floating-point result to the range [0,255] and cast to uint8. – Cris Luengo Nov 19 '18 at 05:37
  • I see, so that allows for even RGB values like 128.45756? Perhaps the right way to find the extreme values then is by differential calculus then. – user3236841 Nov 19 '18 at 05:58
  • Hehe, yes, color is hard! :) -- For example, look at [this diagram on Wikipedia](https://en.wikipedia.org/wiki/SRGB#/media/File:CIE1931xy_gamut_comparison.svg). It shows various different triangles for different RGB standards. This shows that, depending on your definition or RGB, you'll have a different gamut (min and max values) in XYZ. [In the diagram, x=X/(X+Y+Z) and y=Y/(X+Y+Z).] – Cris Luengo Nov 19 '18 at 06:32
1

In general, there are no limits on most color spaces. Many of them can have infinite (and even negative) ranges. For example, when dealing with HDR, RGB values are not clamped in the 0-1 range. Converting some RGB values to Y'CbCr will generate values that will be outside the range of typical analog hardware that displays Y'CbCr values. (If you try to view these values on vector scopes, they will not display correctly.) But they may have valid uses.

Furthermore, even if you are limiting your uses to cases where you want to know the limits with regards to specific use-cases, it may depend on the specific version of each color space you're dealing with. For example, if you're converting CIELAB to CIEXYZ, the answer depends on which white point and chromaticity values you use. (In the linked article, they assume D65 which is common, but by no means the only possible set to use.)

user1118321
  • 25,567
  • 4
  • 55
  • 86
0

You can derive these from the formulae for the conversions. Take a look at the list at http://www.easyrgb.com/?X=MATH for instance. Just insert the mins and maxs for RGB values ( 0 and 255) in RGB->XYZ for instance, and crank it out. Note that for some of these the illuminant makes a difference.

William Oliver
  • 361
  • 1
  • 2
  • 11
  • Doesn't seem like an answer. – Qwertiy Dec 06 '16 at 15:39
  • Sure it is. It ust requires that the OP plug in the values he or she knows and calculate the result. It's essentially the same answer as given for the question about CIELab at [https://stackoverflow.com/questions/19099063/what-are-the-ranges-of-coordinates-in-the-cielab-color-space)], but provides a location where all of the equations are collected rather than just CIELab. – William Oliver Dec 07 '16 at 21:01
0

This OpenCV documentation page describes the range of color values for few of the color spaces that you mentioned. See if you find some info there. For the LUV and LAB color space the range of pixel values would differ based on the datatype of image.

                      L              U              V
Original range:    [0, 100]    [-134, 220]    [-140, 122]
8-bit:             [0, 255]       [0, 255]       [0, 255] 
32-bit float:      [0, 100]    [-134, 220]    [-140, 122]

(The 8-bit values are computed by linearly fitting the original range to 0-255 range)
                      L              A              B
Original range:    [0, 100]    [-127, 127]    [-127, 127]
8-bit:             [0, 255]       [0, 255]       [0, 255] 
32-bit float:      [0, 100]    [-127, 127]    [-127, 127]
MediocreMyna
  • 269
  • 1
  • 5
  • 12