Astronomical Code Logo

Astronomical Code

Toolbox
Back to all tools

RGB to LAB Color Converter

Convert RGB color values to LAB (CIELAB) color space for color-managed workflows.

Enter RGB Values

Click on the color picker to select a color visually

LAB Result

LAB is a device-independent color space designed to approximate human vision. It's widely used in color management systems and for measuring color differences. The L* component represents lightness, a* represents the green-red axis, and b* represents the blue-yellow axis.

How It Works

RGB (Red, Green, Blue) and LAB (CIELAB) are two different color models used for different purposes:

RGB is an additive color model used for digital displays, where colors are created by combining different intensities of red, green, and blue light. Each component ranges from 0 to 255.

LAB is a color space designed to be perceptually uniform and device-independent. It consists of:

  • L*: Lightness component (0 to 100)
  • a*: Green-red component (negative values indicate green, positive values indicate red)
  • b*: Blue-yellow component (negative values indicate blue, positive values indicate yellow)

Converting from RGB to LAB involves two main steps:

  1. RGB to XYZ conversion:
    • Normalize RGB values to [0, 1]
    • Apply gamma correction (sRGB)
    • Apply the RGB to XYZ transformation matrix
  2. XYZ to LAB conversion:
    • Normalize XYZ values using a reference white point (typically D65)
    • Apply a cube root transformation
    • Calculate L*, a*, and b* values using specific formulas

LAB is particularly useful for color management systems, measuring color differences, and working with colors across different devices and media. It's designed to be perceptually uniform, meaning that a change of the same amount in a color value should produce a change of about the same visual importance.

We value your privacy

We use cookies to enhance your browsing experience, serve ads, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies.