User Rating 0.0
Total Usage 0 times
Category CSS Tools
No image selected

Drag & Drop an image here
or paste from clipboard

Click anywhere on the image to pick a specific pixel color.
Dominant Palette
Waiting for image...
Picked History
Click image to pick colors
Active Color
Accessibility (WCAG 2.1)
0.00 Contrast Ratio
AA Normal AA Large AAA Normal AAA Large
The quick brown fox jumps over the lazy dog.
Is this tool helpful?

Your feedback helps us improve.

About

Color extraction is not merely about identifying a hue; it is about quantifying the visual language of an asset. This tool employs the Median Cut Quantization algorithm to partition the color space of an image into representative clusters, deriving a statistically dominant palette. Unlike simple histogram peaks, this method preserves the perceptual balance of the source image.

For professional designers and frontend engineers, precision is non-negotiable. Hex codes, RGB arrays, and CMYK print values are calculated in real-time. Furthermore, the integrated WCAG 2.1 Contrast Auditor ensures that selected foreground/background combinations meet the strict legibility standards required for modern web accessibility (AA/AAA compliance).

color-picker palette-generator accessibility wcag design-tools

Formulas

The foundation of web accessibility lies in Relative Luminance (L), defined by the sRGB color space. The formula normalizes RGB values to a linear scale before applying weights that mirror human perception:

{
Clinear = Csrgb12.92 if Csrgb 0.03928Clinear = (Csrgb + 0.055)1.0552.4 otherwise

Once R, G, and B are linearized, Luminance is calculated:

L = 0.2126R + 0.7152G + 0.0722B

Finally, the Contrast Ratio (CR) between two colors L1 (lighter) and L2 (darker) is derived:

CR = L1 + 0.05L2 + 0.05

Reference Data

WCAG LevelRequirementContrast RatioContext
FAILBelow Minimum< 3.0Decorative elements, disabled text.
AA (Large)Mid-Range 3.0Large text (18pt+ or 14pt bold).
AA (Normal)Standard 4.5Body text, navigation, buttons.
AAA (Large)High Contrast 4.5Large text for visually impaired.
AAA (Normal)Enhanced 7.0Long-form reading, critical UI.

Frequently Asked Questions

We use a Median Cut Quantization algorithm which prioritizes the most significant volume of color data in 3D RGB space. Simple tools often just take a Histogram (most frequent pixels), which ignores color averaging and often misses subtle variations in gradients. Our method ensures a balanced representation of the image's true atmosphere.
No. This tool operates entirely Client-Side using the HTML5 Canvas API. Your image data is processed in your browser's memory and is never transmitted over the network, ensuring 100% privacy.
It uses the exact mathematical formulas defined in the WCAG 2.1 specification. It calculates the Contrast Ratio to two decimal places, checking against the 4.5:1 (AA) and 7.0:1 (AAA) thresholds for standard text.
Yes. The export function generates a valid CSS :root block containing custom properties (e.g., --color-primary: #ff0000;), ready to be pasted into your stylesheet.