Chameleon
Chameleon

Reputation: 10138

What are minimum and maximum thresholds/limits of color schemes RGB, XYZ, LCHab, LCHuv, Lab, Luv?

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

For example:

What is limits for CIE color schemes:

Upvotes: 3

Views: 4161

Answers (4)

MediocreMyna
MediocreMyna

Reputation: 289

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]

Upvotes: 0

user1118321
user1118321

Reputation: 26395

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.)

Upvotes: 1

user3236841
user3236841

Reputation: 1258

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.

Upvotes: 2

William Oliver
William Oliver

Reputation: 371

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.

Upvotes: 0

Related Questions