RGBA to LAB Converter
Enter RGBA values (0–255) and instantly see the CIE LAB (L*, a*, b*) result with intermediate XYZ values and a color preview swatch.
Use the RGBA to LAB Converter
RGBA Input
255
0
0
255
rgba(255, 0, 0, 255)
CIE LAB Output
Alpha: 255 / 255
(100.0%) — passed through, does not affect L*a*b*
Conversion Pipeline
- 1 sRGB gamma decode (linearize): Rl=1.0000, Gl=0.0000, Bl=0.0000
- 2 Linear RGB → XYZ (D65 matrix): X=0.4125, Y=0.2126, Z=0.0193
- 3 Normalize by D65 white (Xn=0.95047, Yn=1.00000, Zn=1.08883): X/Xn=0.4340, Y/Yn=0.2126, Z/Zn=0.0178
- 4 XYZ → CIE LAB: lab(53.24 80.09 67.20)
Copied!
Summary
This tool converts RGBA color values (red, green, blue each 0–255, alpha 0–255) to CIE LAB (L*, a*, b*), a device-independent perceptual color space. The conversion follows the standard pipeline: sRGB gamma decoding (linearization) → multiplication by the sRGB-to-XYZ D65 matrix → normalization against the D65 reference white and the CIE f() cube-root function. Alpha is passed through but does not affect the Lab result, since LAB has no alpha channel. Intermediate XYZ values are displayed so you can inspect every step of the pipeline.
How it works
- Enter R, G, B values (0–255) and Alpha (0–255) in the input fields or drag the sliders.
- Each RGB channel is linearized by reversing the sRGB gamma curve: values ≤ 0.04045 are divided by 12.92; values above that use ((v + 0.055) / 1.055)^2.4.
- The three linear-light values are multiplied by the standard sRGB-to-XYZ D65 matrix to produce X, Y, Z tristimulus values.
- XYZ is normalized against the D65 reference white (Xn=0.95047, Yn=1.00000, Zn=1.08883) and passed through the CIE f() function (cube root or linear segment).
- L*, a*, and b* are computed as: L*=116·f(Y/Yn)−16, a*=500·(f(X/Xn)−f(Y/Yn)), b*=200·(f(Y/Yn)−f(Z/Zn)).
- The color swatch previews the RGB color at the specified alpha. Alpha passes through unchanged and is shown separately.
Use cases
- Convert screen or CSS RGBA colors to CIE LAB for perceptual color analysis.
- Compute color-difference (ΔE) inputs from RGBA values used in design tools.
- Cross-reference colors between sRGB display space and device-independent LAB.
- Inspect the intermediate XYZ values for ICC profile or color management work.
- Generate lab() CSS Color Level 4 values from existing rgba() color strings.
- Validate RGBA → LAB conversions when implementing color science algorithms.
- Check perceptual lightness (L*) and chroma axes (a*, b*) for any RGBA color.
- Build perceptual color palettes by comparing L* values across RGBA swatches.
Frequently Asked Questions
Last updated: 2026-05-28 · Reviewed by Nham Vu