Why Oklab Color Science Revolutionizes Multi-Color Image Tracing
The perceptual mathematics behind human vision, palette extraction, and sub-pixel edge decomposition in Vectra2.
1. The Flaw of Standard sRGB Color Space
Almost all computational graphics tools historically operated in the standard sRGB color space. However, sRGB was designed around the electrical phosphors of 1990s cathode-ray tube (CRT) monitors, not human visual physiology.
In sRGB, Euclidean distance between two colors does NOT correspond to human perceptual difference. For example:
- The human eye is roughly 30 times more sensitive to subtle variations in green luminance than to blue. In sRGB, all three channels are weighted identically ($R=G=B$).
- When interpolating between blue and white in sRGB, the color takes an unnatural detour through purple/magenta.
- A Euclidean step of 20 units in dark blues is barely noticeable to the human eye, whereas a 20-unit step in yellow-greens appears as a starkly different color.
When traditional autotracers cluster colors using sRGB Euclidean distance, they merge subtle facial skin tones into flat muddy patches while simultaneously creating false boundary edges in uniform backgrounds.
2. The Oklab Color Space Formulation
Created in 2020 by Swedish researcher Björn Ottosson, Oklab is a modern color space engineered specifically for perceptual uniformity. In Oklab:
- L (Lightness): Matches human perceived brightness from 0.0 (pure black) to 1.0 (pure white).
- a (Green-Red axis): Negative values represent green; positive values represent red/magenta.
- b (Blue-Yellow axis): Negative values represent blue; positive values represent yellow.
The transformation from linear sRGB to Oklab involves a matrix conversion to cone response coordinates ($LMS$), an approximate cube-root non-linearity simulating retinal photon absorption, followed by an opponent-color matrix rotation:
3. How Vectra2 Uses Oklab for Superior Vector Tracing
In Pix2Vector's Vectra2 engine, Oklab enables two critical breakthroughs:
1. Perceptually Weighted K-Means
Palette clustering evaluates $\Delta E = \sqrt{\Delta L^2 + \Delta a^2 + \Delta b^2}$. Subtle pastel highlights, shadow details, and skin undertones are preserved with true-to-life photographic fidelity.
2. Bilateral Edge-Preserving Denoising
Oklab photometric distance enables bilateral filters to smooth paper grain and JPEG 8×8 block compression noise without softening or blurring razor-sharp 1px boundary edges.
See Oklab multi-color tracing in action
Vectorize photos and complex illustrations with vibrant color fidelity.