Image Color Palette Extractor - Get HEX, RGB & HSL
Pull the dominant colors out of any image and get them as HEX, RGB and HSL, with a WCAG-safe text color for each swatch. Runs entirely in your browser.
Drop images here or click to upload
Supports JPG, PNG, GIF, WEBP, SVG
What the Color Palette Extractor Does
This tool answers a narrow question precisely: if you had to describe this image with a handful of colors, which ones would they be? It decodes your image in the browser, scales it down so the longest edge is about 200 pixels, and reads the raw pixel data off a canvas. Downscaling is not a shortcut that costs accuracy — averaging neighbouring pixels during the scale removes JPEG ringing and sensor noise that would otherwise show up as dozens of nearly identical near-blacks, and it keeps the whole analysis under about forty thousand pixels so it finishes instantly even on a phone. Pixels with an alpha value under 128 are discarded before anything else happens. That single step is what stops a logo on a transparent background from reporting black as its main color, which is the most common wrong answer other extractors give. The remaining opaque pixels are grouped with median cut. Median cut treats the pixels as a cloud in three-dimensional RGB space, wraps a box around them, repeatedly picks the box with the widest color spread weighted by how many pixels it holds, and slices it in two at a point where the color values actually change. Repeating that until there are as many boxes as you asked for gives clusters that follow the real structure of the image, and each cluster reports the average of the pixels inside it rather than an arbitrary bucket center. This is why the results are actual colors from your image instead of the washed-out greys that fixed-grid bucketing produces. The ordering is then adjusted. Ranking purely by pixel count is a trap: a photograph is often forty percent sky or white studio backdrop, and a raw count puts that first and buries the colors you actually wanted. Near-neutral, near-black and near-white clusters are therefore given less weight when the list is sorted, though they are never dropped and the percentage shown next to each swatch is always the true, unmodified pixel share. Finally, every swatch gets a text color computed from its WCAG 2.1 relative luminance, choosing black or white by whichever has the higher contrast ratio against that specific color. That test uses luminance, not lightness, so it gets mid-tones right where a simple brightness threshold flips to the wrong answer.
Why Extract a Palette From an Image
Design work usually starts from something visual — a photo, a screenshot, a moodboard, a logo someone emailed you — and ends with values you have to type into code. This closes that gap without a round trip through a design app.
How to Extract Colors From an Image
Four steps, no account, and nothing leaves your device — the image is decoded and analysed locally in your browser.
Drop in a JPG, PNG, WebP, GIF or SVG — extraction starts automatically as soon as it loads
Choose how many colors you want: 4 for a tight brand set, 10 to capture more of a busy photograph
Click any HEX, RGB or HSL value on a swatch to copy it, or use Copy all HEX to grab the whole set at once
Export a CSS variables snippet, a Tailwind config block, or render the palette as a PNG and download it
Frequently Asked Questions
More Image Tools
Explore other powerful tools for your image editing needs
Compress Image
Reduce file size
Resize Image
Change dimensions
Crop Image
Cut out area
Convert Format
Change format
Photo Editor
Edit photos
Rotate Image
Rotate image
Flip Image
Horizontal/Vertical
Add Watermark
Add watermark
Add Border
Add image border
Rounded Corners
Add rounded corners
Filters
Brightness/Contrast
Blur Face
Hide faces
Mosaic
Blur regions
Remove Background
Remove BG
Enhance Image
AI upscale
Add Text
Add text to image
Collage
Combine multiple images
HTML to Image
Webpage to image
GIF to Image
Extract frames
Trim Image
Remove empty edges
Batch Rename Images
Safely rename files in bulk
Circle Crop
Crop images into circles
Black & White
Convert images to grayscale
Split Image
Cut an image into a grid
Merge Images
Combine images into one
Change DPI
Set image DPI metadata
Image to Base64
Encode images as Base64
Image to PDF
Combine images into one PDF
HEIC to JPG
Convert iPhone HEIC photos to JPG
EXIF Remover
View and strip hidden photo metadata, including GPS location
Favicon Generator
Full icon set plus HTML