Skip to content
DECODED BUYER 9-Tool Hub
← Back to All 9 Utilities Hub100% Client-Side Browser Studio
Free Color Palette & Contrast Tool 100% Client-Side • Zero Upload

Image Color Palette Extractor & Contrast Checker

Get the main HEX, RGB and HSL colors from any image, click any pixel with the eyedropper, check WCAG contrast between two colors and copy a ready CSS gradient.

Quick answer: drop an image below to see its 6 main colors, then click the picture to read any exact pixel. For readable text, WCAG asks for a contrast ratio of at least 4.5:1 (Level AA) for normal text and 3:1 for large text.
Try a sample:
Drop an image here, click to browse, or paste one with Ctrl+V
JPG, PNG, WebP or GIF • read in your browser, never uploaded
Click or tap the image to sample the exact pixel color.
Picked color & text contrast
Aa Sample text
#0F172A
rgb(15, 23, 42)
hsl(222, 47%, 11%)

Main colors in the image (click one to inspect)
CSS gradient from the main colors
background: linear-gradient(135deg, #0F172A, #2563EB);

Contrast checker: any two colors

Type two colors or use the buttons to take the color you picked from the image. Results follow WCAG 2.x.

Readable headline
Body text example for this color pair

16.9:1

    Colors are read from a copy of your image scaled to at most 1024 pixels, so tiny differences from the original file are possible.

    By the Decoded Buyer team • Last updated: November 17, 2026 • Reading time: 8 min

    How the Palette Extractor Works

    A digital photo can contain hundreds of thousands of different colors, but people see an image as a few main colors. To find them, the tool reads the pixels of your image from an HTML5 canvas, sorts them into groups of similar colors, and keeps the groups that cover the most area. For each main color it shows the average of the pixels in the group, so the value is a real color from your image, and it shows what share of the picture that color covers.

    Two similar shades, such as two blues in a sky, are merged instead of taking up two of the six slots, which keeps the palette varied. Transparent pixels are ignored, so a logo with a see-through background gives you the colors of the logo and not the empty space.

    Keep in mind that this is an estimate of the main colors. A palette will not match the exact value of a specific pixel, and different tools can give slightly different results for the same image because they group colors in different ways. When you need one exact value, use the eyedropper.

    HEX, RGB and HSL Explained

    The same color in three formats
    FormatExampleWhere it is used
    HEX#2563EBThe most common web color code, used in CSS, Figma, Canva and most design tools.
    RGBrgb(37, 99, 235)Red, green and blue values from 0 to 255, used in code, video editors and the canvas API.
    HSLhsl(221, 83%, 53%)Hue, saturation and lightness. The easiest format for making a color lighter, darker or softer.

    All three describe the same color, so you can switch between them without any loss. Use HEX when you share a color with someone, and HSL when you want to build a lighter or darker version of it.

    Using the Eyedropper

    Click or tap anywhere on the picture, and a marker shows the spot while the panel on the right shows the HEX, RGB and HSL value of that pixel. Photos and JPG files contain tiny color noise from compression, so two neighbouring pixels of what looks like the same color can differ by a few values. For a flat area such as a background, click two or three spots, and if you want a safe value, use the main color from the palette instead of a single pixel. If you click a fully transparent pixel, the tool tells you instead of showing a wrong color.

    WCAG Contrast Ratios Explained

    The Web Content Accessibility Guidelines (WCAG) measure contrast as a ratio between the brightness of two colors, from 1:1 (identical colors) to 21:1 (black on white). The brightness is the relative luminance of each color, worked out from its red, green and blue values. A higher ratio makes text easier to read, especially for people with low vision, on a small screen or in bright light.

    WCAG 2.x minimum contrast ratios
    What you are checkingLevel AALevel AAA
    Normal text4.5:17:1
    Large text (about 24 px, or 19 px bold, and up)3:14.5:1
    Icons, buttons and input borders3:1no separate level

    A passing ratio does not guarantee that text is comfortable to read. Very thin fonts, small sizes, patterned backgrounds and light text over a busy photo can still be hard to read. Newer methods of measuring contrast are being discussed, but the WCAG 2.x ratios above remain the standard in most guidelines and laws, so they are what this tool uses.

    Contrast for Thumbnails, Buttons and QR Codes

    • YouTube thumbnails. Text and faces have to stay clear at a very small size. Pick the background color of your thumbnail with the eyedropper, check it against white and black text, and then test the design in the YouTube Thumbnail & Title Preview Tool.
    • Website buttons and links. Check the button text against the button color, and the button color against the page background, because buttons count as interface components that need 3:1.
    • QR codes. Scanners need strong contrast between the dots and the background, with dark dots on a light background. Check your two colors here before you make the code in the Custom QR Code & Wi-Fi Generator.
    • Video subtitles. Make sure the subtitle color stays readable over the main colors of your footage, and keep the text inside the safe area shown by the Reels, Shorts & TikTok Safe Zone Checker.

    CSS Gradients and Color Variables

    The gradient box builds a ready-to-use linear-gradient from the two or three biggest colors in your image, which is a quick way to make a background that matches a photo or a logo. Press Copy CSS and paste the line into your stylesheet. The Copy as CSS variables button gives you a block like --color-1: #2563EB; that you can paste into your :root, so the same colors can be reused across a site. Check the text that will sit on top of the gradient with the contrast checker, because a gradient has a different contrast at each end.

    How to Use This Tool

    1. Drop an image on the box, choose a file, paste a screenshot with Ctrl+V, or load a sample.
    2. Read the 6 main colors and the share of the picture each covers.
    3. Click the picture to pick an exact pixel, or click a swatch to inspect a palette color.
    4. Check the contrast of the picked color against white and black text in the panel.
    5. Open the contrast checker to test any two colors, then copy the HEX, CSS gradient or CSS variables you need.

    Common Color Mistakes

    • Trusting a single pixel. A photo has noise, so sample a few spots or use the palette value.
    • Judging contrast by eye. Colors that look fine on your bright monitor can be hard to read on a phone outside.
    • Light gray text on white. It looks clean, but it often fails the 4.5:1 rule.
    • Using color alone to carry meaning. Add an icon or a label, because some people cannot tell certain colors apart.
    • Forgetting the hover and disabled states. Check them too if you use these colors in a user interface.

    How We Verify This Tool

    The contrast calculation follows the WCAG 2.x formula for relative luminance and is checked against well-known pairs, for example black on white, which gives exactly 21:1. The eyedropper reads the pixel under the marker, and the marker position is checked against images with known colors on each side. The palette is built from the real pixels of your picture, so the same image always gives the same result. Colors on your own screen can look a little different depending on the display and the color profile, so use the values here as the source of truth for the file.

    Frequently Asked Questions

    Are my images uploaded to a server?

    No. The image is drawn on an HTML5 canvas inside your browser and the pixels are read there. Nothing is uploaded.

    How do I get the exact color of one pixel?

    Click or tap the spot on the image. The panel next to it shows the HEX, RGB and HSL value of that pixel and a marker shows where you picked.

    Why are the palette colors slightly different from the colors I see?

    The palette groups similar colors together and shows their average, so it describes the main colors of the picture rather than one exact pixel. JPG compression also adds small color noise. For one exact value, use the eyedropper.

    What contrast ratio do I need for readable text?

    WCAG asks for at least 4.5:1 for normal text (Level AA) and 7:1 for the highest level (AAA). Large text needs 3:1 for AA and 4.5:1 for AAA. Icons and input borders need 3:1.

    Does it work with transparent PNG logos?

    Yes. Transparent areas are ignored when the palette is built, so you get the colors of the logo itself. If you click a fully transparent pixel, the tool tells you instead of showing a wrong color.

    Which color format should I use, HEX, RGB or HSL?

    They describe the same colors. HEX is the most common in CSS and design tools, RGB is used in code and video tools, and HSL is easiest when you want to make a color lighter, darker or less saturated.

    More free tools: see all utilities on the Decoded Buyer hub. This tool is free and does not collect your images.