Skip to content
Tools on Deck

How to Pull a Color Palette from a Photo

4 min read

A photo or logo can provide a practical starting palette for a website, slide deck, report, or brand document. The Color Palette from Image tool finds 3 to 12 dominant colors and shows each one as HEX, RGB, and HSL with its share of visible pixels.

You can copy one value, copy every HEX code, copy CSS variables, or download palette.png and palette.json. The image is analyzed entirely in your browser and is never uploaded. Treat the result as a summary of the picture, then choose the colors that serve your actual layout.

Choose the right source image

Use the cleanest version of a logo when you want brand colors. A screenshot can include browser chrome, shadows, or a background that changes the extracted result. For a photograph, decide whether you want the mood of the whole scene or the colors of one subject before selecting the file.

Large background areas usually earn a large share in the palette. A product on a white backdrop may produce white or near-white as the first swatch, even when the product color matters more to you. That is not an error; it reflects how much of the visible image belongs to each color group.

If an unwanted wall, desk, border, or transparent margin dominates the frame, use the image cropper to isolate the useful area first. A focused crop often gives a palette that better matches the part you plan to feature in a page or presentation.

Understand HEX codes and the other values

A HEX color is a web-friendly label beginning with #, followed by six hexadecimal characters, such as #2f6fdf. The three pairs represent red, green, and blue channel values. You can paste a HEX value into many website editors, design tools, presentation themes, and document color pickers.

RGB expresses the same color as red, green, and blue numbers. HSL describes hue, saturation, and lightness, which can be easier when you want to make a related color lighter, darker, stronger, or softer. The tool gives all three forms so you can use the notation expected by your destination.

The percentage on each swatch estimates what share of the sampled visible pixels belongs to that color group. Swatches are listed with the largest share first. It is useful for understanding the image, but it is not a rule for how much of each color your design should use.

How to extract a palette from an image

The tool accepts one PNG, JPG, WebP, GIF, BMP, or AVIF image up to 50 MB. It samples a reduced copy whose longest side is at most 200 pixels, then groups similar visible colors. Mostly transparent pixels are ignored.

  1. Add a PNG, JPG, WebP, GIF, BMP, or AVIF image.
  2. Move Number of colors to choose between 3 and 12 swatches.
  3. Read the HEX, RGB, and HSL values and the percentage shown for each color in the Palette panel.
  4. Use the copy button beside a value, or select Copy all HEX for a comma-separated list.
  5. Select Copy CSS variables to get custom properties named --color-1, --color-2, and onward.
  6. Select Download palette.png for a labeled swatch strip or Download JSON for palette.json.

Turn extracted colors into a usable design palette

Do not give every extracted color equal importance. Choose one or two colors for identity, one restrained background or surface color, and one accent for calls to action or highlights. A photograph may contain several similar greens or browns that are accurate but redundant in a small interface.

For a slide deck, use the image's quieter colors for backgrounds and large shapes, then reserve a stronger swatch for headings or charts. For a website, test text contrast rather than assuming a dominant color is readable. The palette reports colors, but it does not certify accessibility or decide which foreground pairs are safe.

When a swatch is close but not quite right, use the color converter to inspect it, create tints and shades, and check contrast. Keep a note of the chosen HEX codes so buttons, headings, charts, and future documents use the same values instead of approximate visual matches.

Know why results can differ from what you expect

The extraction uses median-cut grouping. Similar pixels are placed into color groups and each group is represented by an average. That means a swatch may be a representative color that does not appear as one exact pixel in the original. Gradients, shadows, and detailed photos make this averaging more noticeable.

Asking for more colors can split a broad group into several more specific swatches. Asking for fewer colors produces a simpler summary. A flat graphic with only a few distinct colors may return fewer swatches than requested because there is nothing useful left to divide.

The same image and color count produce the same ordered result because the method has no random step. A fully transparent image produces no visible colors. Animated input is decoded as an image by the browser workflow, so use a still source that clearly represents the appearance you want to match.

Quick answers about photo color palettes

How many colors should you choose? Start with six for a useful overview, then reduce the count for a simpler scheme or increase it when the image contains several important areas. Is the first swatch automatically the brand color? No. It is the largest sampled group, which may simply be the background.

Can you use the HEX codes in a website or slide deck? Yes, if the editor accepts custom colors. Should you copy every extracted color into the final design? Usually not. Select a small set with clear roles, check text contrast, and compare the design beside the source image before standardizing the palette.

Try it free