LOCAL IMAGE TOOL Never uploaded

Image Palette

Find the colors that define an image. Sample it locally with Canvas, group nearby shades, and copy a practical top-color palette in seconds.

Image palette workspace

01 / IMAGE

Choose one image

Drop an image here or browseJPEG, PNG, WebP, GIF, or another browser-readable image.
Choose an image to get started.
02 / SAMPLING

Set palette detail

6 colors
Nearby pixels are grouped into quantized color buckets.
140 px
Higher values preserve more small color regions.
Private by design. Canvas sampling runs in this tab; no image data is uploaded.
03 / PREVIEW

Image sample

—
Load an image to see its Canvas preview.
04 / PALETTE

Top colors

No colors yet
Your extracted colors will appear here.

How image palettes work

This tool scales your image down to a manageable sample, reads its pixels with the Canvas API, and places nearby RGB values into the same quantization bucket. The most frequent buckets become the palette, sorted by how often they appear. It is a useful starting point for UI themes, illustrations, photo studies, and brand explorations.

How the conversion runs

Analysis runs in two passes over a canvas. First the picture is drawn scaled so its longest edge matches the sample size slider, which keeps a 6000-pixel photograph from being read pixel by pixel; the preview canvas above is a separate, smaller copy capped at 900 pixels and never feeds the numbers. The sampling pass then walks the image data, skips any pixel whose alpha is below 32, and rounds each red, green and blue value to the nearest multiple of 16 — a 16×16×16 quantisation grid that turns millions of shades into a few thousand buckets. Buckets are counted, sorted by how many pixels landed in them, and the top N (your colour count) are returned with their share of the sampled pixels. Download the result as lucentool-palette.json (rank, hex, rgb, share) or as a CSS file of --palette-1 custom properties.

Edge cases and hard limits

Each image is capped at 30 MB; anything larger is rejected before a canvas is created. Quantisation is lossy by design, so two close tones can merge into one bucket and the hex you receive is the centre of a bucket rather than a pixel-exact value — that is why the exported colours look deliberate rather than photographic. Fully transparent pixels are ignored, which is what you want for a logo on a transparent background but means soft shadows fading to nothing contribute nothing. Ranking is by area, so a small but important accent colour can miss the top slots unless you raise the colour count. Formats depend on your browser's decoder: PNG, JPEG and WebP are safe, SVG, AVIF and TIFF may or may not open.

Privacy: processed in your browser

The image is drawn into a canvas in this tab and never uploaded; there is no server on this site, so the pixels cannot leave your machine. The JSON and CSS exports are generated in memory and saved by your browser, and the palette tool makes no network requests at all.

Frequently asked questions

Why did I ask for 8 colours and only get 5?

Because the image contains fewer than eight distinct quantisation buckets after rounding. A flat graphic, a black-and-white scan or a picture with a heavy gradient will collapse into a handful of buckets; ask for fewer colours or raise the sample size for more resolution.

The palette misses the accent colour I care about. What can I do?

The list is ranked by pixel area, so a small logo or a bright detail is easily outvoted by a large background. Increase the colour count, reduce the sample size so fewer shades merge, or crop the image to the region you care about before analysing it.

Are the exported hex values exact colours from my image?

No. Each value is the centre of a quantisation bucket created by rounding every channel to a multiple of 16, so it represents a group of similar pixels. That makes the palette stable and easy to use in CSS, but it is not a pixel-exact colour picker.