lab2xyz: CIELAB to CIE XYZ Color Space Conversion
Intermediate Color Space Transformation
The lab2xyz
function converts colors from the CIELAB color space to CIE XYZ, serving as the essential intermediate step for color space transformations. This conversion applies the inverse CIE LAB formula with proper gamma correction and white point normalization.
Mathematical Implementation
The transformation uses the inverse LAB formula with threshold-based calculations:
For each component, the conversion applies:
The final XYZ values are scaled by the CIE D65 white point and normalized to 0-100 range.
XYZ Color Space Visualization
Live Editor
const fragment = () => { const center = vec2(0.5) const p = uv.sub(center).mul(50) const L = uv.y const A = p.x const B = p.y const labColor = vec3(L, A, B) const rgbColor = lab2xyz(labColor) return vec4(rgbColor.max(0).min(1), 1) }