Image color picker

Open an image, then click any point to read that pixel's color, or extract its main colors with how much of the picture each one covers.

Or drag an image here, or paste one with Ctrl+V / ⌘V. PNG, JPEG, WebP, GIF and other formats your browser can open. The image is read on your device and never uploaded.

Picked color

No color picked yet. Open an image and click a point on it.

Picked colors

    Dominant colors

    1. Open an image to see its dominant colors.
    Export format
    Picked colors
    Dominant colors

    How to use the image color picker

    1. Choose an image file, drag one onto the box, or paste a screenshot with Ctrl+V (⌘V on a Mac). To see how it works first, press Try a sample image.
    2. Move the pointer over the picture: the round magnifier shows the pixels under it on a grid, with the center pixel outlined. Click or tap to pick that pixel's color.
    3. Read the color as HEX, RGB, HSL and OKLCH, with the nearest CSS color name, and copy any value. Every pick is added to Picked colors, where you can remove colors you don't need.
    4. Without a mouse, focus the image with Tab, move the crosshair with the arrow keys (hold Shift for 10-pixel steps) and press Enter to pick.
    5. Under Dominant colors, set how many colors to extract, from 3 to 12. Each color shows the share of the image it covers.
    6. Choose an export format (CSS variables, JSON or a HEX list) and copy the picked colors or the dominant colors.

    What this image color picker does

    It does two jobs. The picker reads the exact color of one pixel, like the eyedropper in an image editor. The palette extractor looks at the whole picture and finds the few colors that cover most of it, with a percentage for each.

    Everything happens in your browser. The file is decoded onto a canvas on your device and nothing is uploaded. Your picked colors are kept in this browser's local storage so they survive a reload; the image itself is not stored.

    How picking works

    The image is drawn onto a canvas at its full resolution, and a pick reads the red, green, blue and alpha values of the pixel under the pointer. The image on screen is usually scaled to fit, so one screen point can cover several image pixels; the magnifier shows the real pixels around the pointer so you can aim at a single one. Very large images (over 16.7 million pixels, for example 5000 × 4000) are scaled down to that size first, because some browsers limit how large a canvas can be; the page tells you when this happens.

    The canvas stores colors in sRGB, so browsers normally convert an image with an embedded color profile to sRGB when they draw it, and the values are the ones CSS would use. Colors in wide-gamut photos (Display P3, for example) that lie outside sRGB may be clipped.

    How the dominant colors are found

    1. Downsampling. Images larger than 512 pixels on the longest side are scaled down to 512 for the analysis. That keeps it fast and barely changes the result, because the palette describes large areas, not single pixels. Picking still uses the full-resolution image.
    2. Skip transparency. Fully transparent pixels are ignored. Partly transparent pixels count in proportion to their opacity, so a 50% transparent pixel counts as half a pixel.
    3. Group similar pixels. Colors are collected into 32,768 small bins (5 bits per channel), each holding the average of the real colors that fell into it.
    4. Cluster in OKLab. The bins are clustered with weighted k-means in OKLab, a color space designed so that equal distances look about equally different. Starting points are chosen with k-means++ from a fixed random seed, so the same image and settings always give the same palette.
    5. Report. Each cluster's average color becomes a palette entry, and its share is the weight of its pixels divided by the weight of all non-transparent pixels. Entries are sorted from largest share to smallest.

    Worked example: the sample image

    The sample is a flat-color landscape of 480 × 320 pixels with a transparent top-right corner. With 6 colors, the extractor returns:

    ColorHEXShare
    Sky#8ECAE642.0%
    Near hill#26465325.4%
    Far hill#2A9D8F13.1%
    Sand#E9C46A9.9%
    Lake#219EBC7.4%
    Sun#FFD1662.1%

    These are exactly the six colors the sample was drawn with, and the shares are their areas; the transparent corner does not count. With only 3 colors, similar areas have to share a cluster: the sky, sand and sun merge into #A6CBCE (54.0%), the two blue-green areas into #269EA0 (20.6%), and the dark hill stays #264653 (25.4%). A merged color can be one that appears nowhere in the image, so choose more colors when you need the real ones.

    Picking the sun gives #FFD166, rgb(255, 209, 102), hsl(42, 100%, 70%) and oklch(88.03% 0.1348 86.06). Its nearest CSS name is khaki (#F0E68C), at a deltaE OK of 0.054.

    Exports

    Common mistakes

    Key terms

    Eyedropper
    A tool that reads the color of a single pixel on screen or in an image, named after the dropper used to take a sample of paint.
    Dominant colors
    The few colors that cover the largest share of an image, found by grouping similar pixels. They summarize a picture's palette but are averages, so they may not match any single pixel exactly.
    K-means clustering
    A method that splits data into k groups by repeatedly assigning each point to the nearest group center and moving each center to the average of its points. Used here to group pixel colors.
    k-means++
    A way to choose k-means starting centers: after the first, each new center is chosen with probability proportional to its squared distance from the nearest center already chosen, which spreads the centers out.
    OKLab
    A perceptual color space published by Björn Ottosson in 2020, with lightness L and two color axes a and b. Equal distances in OKLab look roughly equally different, which makes it suitable for averaging and comparing colors.
    Downsampling
    Reducing an image to fewer pixels by scaling it down. It speeds up whole-image analysis such as palette extraction while keeping the large color areas.
    Color quantization
    Reducing the colors in an image to a smaller set that still represents it. Palette extraction is a form of color quantization.

    Frequently asked questions

    How do I get a color palette from an image?
    Open the image and read the Dominant colors list: it shows the 3 to 12 main colors (6 by default) with how much of the picture each covers. Change the number of colors to get a broader or finer palette, then copy it as CSS variables, JSON or a HEX list.
    Is my image uploaded?
    No. The file is read and decoded by your browser on your device, and no image data is sent anywhere. Only your picked colors and your settings (number of colors and export format) are saved, in this browser's local storage; the settings also appear in the page address.
    How do I get the HEX code of a color in an image?
    Open the image, hover to aim with the magnifier, and click. The HEX code appears under Picked color with a Copy button.
    Why are the dominant colors not exactly in my image?
    Each dominant color is the average of a cluster of similar pixels, so it can sit between the real shades. Raising the number of colors makes the clusters tighter and closer to real pixels.
    Does it work with transparent PNGs?
    Yes. Fully transparent pixels are skipped when extracting colors, partly transparent pixels count by their opacity, and picks show the alpha value.
    Why does the same image always give the same palette?
    The k-means starting points come from a random number generator with a fixed seed, so the same image and settings give the same palette in the same browser. Large images are scaled down by the browser first, and browsers can scale slightly differently.
    Can I pick colors from my screen rather than an image?
    Take a screenshot and paste it here with Ctrl+V or ⌘V. The screenshot is read locally like any other image. Screenshots of interfaces keep exact pixel colors; screenshots of photos may already be resized or recompressed.
    What does the nearest CSS name mean?
    It is the CSS named color closest to the pick, measured as deltaE OK distance in OKLab. A small distance means the name is a close match; it is rarely exact.

    Sources: Björn Ottosson: A perceptual color space for image processing (OKLab), CSS Color Module Level 4: OKLab and OKLCH, Arthur and Vassilvitskii: k-means++ (2007). Last checked 2026-11-17.