Lab 02 · Rust + image decoding

Dominant color.

Drop in an image. The edge decodes it, samples its palette, and returns one color expressed across the color systems designers actually use.

Interactive walkthrough

Watch four pixels become one color.

Move through the same bins, weighted means, K-Means passes, and family vote used by the Rust color kernel.

dominant color · step 1 of 8
the starting picture · 4 pixels
P1α 255
coral
232, 76, 58
P2α 255
coral light
239, 79, 63
P3α 255
teal
44, 182, 164
P4α 255
gold
242, 193, 78

Input

Give it a frame.

Images up to 4K and 32 MB are accepted. AVIF, JPEG XL, JPEG, PNG, WebP, GIF, and TIFF are decoded inside the Rust Worker.

Output

A color, unpacked.

The response stays intentionally inspectable: the full JSON is the artifact, with the dominant swatch as its visual checksum.

Your formatted color JSON will appear here.

The analysis kernel is shared Rust code compiled into the Cloudflare Worker as WASM. Transparent pixels are ignored, and the winning color is selected from a quantized, alpha-weighted pixel histogram.