SBOA567 December   2023 OPT4048 , OPT4060

 

  1.   1
  2.   2

Introduction

The global market for color light sensors is rapidly increasing as customers demand a better user experience with attractive display interfaces. This growth is across various industrial, automotive, and consumer applications such as laptops, tablets, automotive displays, appliances, medical equipment, and human-machine interfaces (HMI). Color light sensors detect the brightness and color wavelength of the incident light, enabling applications to adjust color and brightness based on environmental lighting conditions. The type of color sensor technology used impacts the sensing performance. This article compares the technical differences between RGB and XYZ color sensors and provides a guideline on which sensor to choose for an application.

Overview of RGB and XYZ Color Sensors

There are two types of color sensors, RGB and XYZ. The XYZ sensor senses a complete standardized color space, while RGB reads an unstandardized subset of the standard color space. RGB then indirectly mapped to the standardized color space for color correction or calibration, which introduces inaccuracies. Choosing one color sensor over the other depends on the application's accuracy equirements.

  • RGB: Shown in Figure 1, an RGB color sensor senses an unstandardized color space in which red (R), green (G), and blue (B) values combine to represent various colors. Typically, R, G, and B values range from 0 to 255. A value of 255 for all three colors produces white, and a value of 0 for all three colors produces black. The RGB color space does not have a universal standard making RGB color sensors device-dependent. Different devices detect RGB values differently, and the color measured varies from manufacturer to manufacturer or even in the same device over time.
  • XYZ: One of the challenges with RGB is that the unstandardized color space cannot observe all colors, thereby leaving this color space incomplete. CIE 1931 XYZ Color Space Standard, shown as the large curve in Figure 1, can help alleviate this issue. This standardized color space represents all visible colors. This standard is absolute, independent of the device or manufacturer variation, and more accurate and sensitive to color variation than a sensor based on the RGB color space. In addition, the Y channel of an XYZ sensor has a photopic response to extract a value of lux or brightness.
GUID-8E8E24CC-4DE1-4AF2-A2D7-74AB4E1FD509-low.jpg Figure 1 RGB and XYZ Color Spaces Coordinates

Comparison between RGB and XYZ Color Sensors

Selection between the two color sensors depends on the application requirements for the accuracy of color measurement. This section discusses the color sensor use cases and compares RGB and XYZ color sensors for each use case.

Ambient Light Color Sensing

Ambient light color sensing, the detection of environmental light's correlated color temperature (CCT), is one of the most common use cases for color sensors. The color temperature of a display or lighting system is adjusted based on the ambient light color sensed. Cameras can use CCT for color temperature correction in the output video or images. In most cases, the desired color sensor output is white light. However, for example, the light temperature is warmer outdoors during sunset and cooler during the middle of the day. Display applications use the CCT values, as shown in Figure 2, to adjust the display's color profile so the images seem natural by matching the environment's light temperature. This adjustment improves the visual appearance of displays or camera feeds, as shown in Figure 3, rather than causing a harsh contrast in lighting temperature without the adjustment.

GUID-DC72363D-7EE9-4FFF-BAC0-2C74B82A671D-low.jpg Figure 2 Correlated Color Temperature (CCT) Spectrum
GUID-FBBD41B9-EB14-4968-9890-28AE71550864-low.jpg Figure 3 Example of Warm, Neutral (Sheet of Paper), Cool CCT

RGB sensors are not standardized and often require calibration to convert the RGB coordinates to the CCT spectrum. There is no straightforward way to determine if a color point maps to the CCT spectrum. While some manufacturers provide a conversion matrix or a simple linear equation to convert RGB color coordinates to the CCT spectrum, the conversion accuracies vary. In addition, non-white light is often mapped to the closest CCT value and provides invalid results.

XYZ sensors map to the nearest CCT value without calibration. To determine if a color point maps to the CCT spectrum, the common practice is to convert the XYZ coordinates to the UV color space. With a simple equation, determine the distance of the color point from the black body curve. The black body curve represents the color a human eye perceives in CIE YX and CIE UV spaces, shown in Figure 4 when a black body of certain Kelvins emits radiation. The intersecting lines with various kelvin markings are iso-thermal lines representing the same color temperature and are the CCT values. CCT is often valid only around the black body curve and does not make sense when there is too much deviation. Any color coordinates close to the black body curve can represent a particular CCT.

If a cover material such as glass is over the light sensor, RGB and XYZ sensors require calibration.

GUID-CCC07E16-DF69-4590-8A4A-25A265089F65-low.jpg Figure 4 CIE XY and CIE UV Space Plots of Color Coordinates

Relative Color Matching

There are many applications, such as overhead lighting control, where a color sensor is used as feedback to keep the lighting color constant. These applications are an example of relative color matching.

For example, light sources such as LEDs change color under different conditions such as temperature, driver current, PWM dimming, and aging. Many lighting systems add blue and red LEDs to offset any change in color from the white LEDs. If the color sensor shows the color point has shifted from the original factory calibration, the colored LEDs blend until the factory calibration and color sensed match again.

RGB and XYZ sensors are effective in relative color-matching applications without needing color calibration. Since only one color point can match and share the same color space, an XYZ sensor's ability for brightness measurements does not offer a significant advantage.

Absolute Color Matching

There are also applications where measuring an exact color point is needed. In this case, the color is not subjective to a relative color point but requires an objective match between two colors without comparing them directly. These applications require absolute color matching.

For example, color sensors can determine paint color. Paint changes color over time due to exposure to heat and sunlight. After some time, some sections of a painted surface need patching. The overall paint color has changed from the original color. The new paint matches the current color to avoid standing out. If the color sensor uses the sensor's own color space, such as with an RGB sensor, there is no way to communicate the paint color with other color spaces. The paint manufacturer very likely uses a different color space. Matching the RGB color sensed to a specific manufacturer's paint color is challenging.

XYZ sensors sense color in the standardized CIE 1931 XYZ Color Space. Therefore, even if the paint manufacturer works in a different color space, their color space can convert to the standardized XYZ space.

On the contrary, an RGB sensor often requires a complex calibration to match the two spaces. The color accuracy of the RGB sensor is limited.

Ambient Light Lux Sensing

Measuring the light intensity value (lux) is desirable in many light-sensing applications. For the best possible user experience, the display brightness adjusts to match the environmental light brightness by using the lux value.

For RGB color sensors, sensing lux is more complicated and limited. Typically, no channel of an RGB color sensor provides a photopic response. Calibration and a matrix are required and vary in accuracy across the color gamut.

Using XYZ color sensors, the Y channel has a photopic response and is linear to lux. The color sensor manufacturer usually provides a ratio or simple single-point calibration to determine the Y and lux ratio.

Summary

In summary, RGB color sensors (such as TI's OPT4060) and XYZ color sensors (such as TI's OPT4048) can sense and distinguish different colors. RGB color sensors do not represent the entire visible color spectrum and are dependent on the light source and type, unlike XYZ color sensors. While most applications use either an RGB color sensor or an XYZ color sensor, there are advantages and disadvantages to using either color sensor type. While usually more cost-effective, RGB sensors require additional calibration and transformations, but are typically less accurate when compared to an XYZ sensor.

For more information and training on TI light sensors, visit Precision Labs Training Videos: Light Sensors.