Color Palette From Image

A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call

Free color palette generator from an image. Upload a photo or logo and get its main colors as HEX and RGB codes, with CSS variables to copy.

CSS variables

Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.

How to get a color palette from image files

Getting a color palette from image files takes one step. Choose an image: a photo, your logo, a product shot, a screenshot of a website you like. The tool finds its main colors straight away and shows each one with:

  • a swatch,
  • its HEX code, with a Copy button,
  • its RGB values,
  • how much of the image it covers, largest first.

Choose how many colors you want, from 5 to 10. Below the swatches, you get the palette as CSS variables, ready to paste into a stylesheet. Transparent areas of PNG images, such as the background around a logo, are ignored.

The image never leaves your device: it's read and analysed entirely in your browser.

How the colors are found

Every image contains thousands of slightly different colors. To find the main ones, the tool:

  1. Shrinks the image to a small working copy, which keeps the colors but makes the analysis fast.
  2. Groups similar colors using a variant of the median cut algorithm: it repeatedly splits the group of colors with the widest spread, at the point where that color channel crosses its average, until it has as many groups as you asked for.
  3. Averages each group into a single color, and measures how many pixels it covers.

Splitting at the average, rather than exactly in the middle, keeps distinct colors apart. If 60% of an image is red and 40% blue, you get one red and one blue, at 60% and 40%, rather than a muddy purple in between.

Because each color is an average of a group, it may not match any single pixel exactly. It represents the overall color of that part of the image, which is usually what you want for a palette.

What to use an image color palette for

Building a brand palette from your logo

If you have a logo but no official color codes, pick colors straight from it. Upload the logo (a PNG with a transparent background works best), choose 5 colors, and copy the HEX codes into your brand guidelines.

Matching a website or social graphics to a photo

Pull colors from your best product or shop photo to use in headings, buttons and backgrounds, so graphics feel connected to the photography.

Finding inspiration

Upload a photo, painting or place you love and use its palette as the starting point for a design.

Checking a design's colors

Upload a screenshot to see which colors dominate a page, an ad or a social feed.

Turning a palette into a usable color scheme

A palette straight from a photo is a starting point. To make it work for a brand or website:

  • Pick one main brand color from the palette, often the most distinctive rather than the most common.
  • Choose a dark color for text and a light one for backgrounds. Text is often a near-black, not a color from the image.
  • Use one accent for buttons and links.
  • Follow a simple ratio such as 60-30-10: 60% neutral background, 30% secondary color, 10% accent.
  • Check contrast. Bright colors often don't have enough contrast for text. The color contrast checker tests any text and background pair against accessibility standards, and suggests the nearest color that passes.

The HEX to RGB converter turns each color into RGB and HSL, which makes it easy to create lighter and darker shades of the same color.

Tips for better results

  • Crop to what matters. If you want the colors of a product, crop out the background first.
  • Use a good-quality image: heavily compressed images can shift colors.
  • For logos, use a PNG with transparency, so the background doesn't count.
  • Ask for more colors if the image is busy, then keep the ones you like.
  • Remember screens differ: colors look slightly different on different screens, and printed colors differ again.

Screen colors and print colors

The palette uses HEX and RGB, the color models for screens. Printed materials use CMYK inks or Pantone spot colors, and converting between them isn't exact: some bright screen colors can't be printed. If you're preparing print materials, ask your printer or designer for the closest CMYK or Pantone matches to your HEX codes.

Using the CSS variables

The CSS output looks like this:

:root {
  --color-1: #C8A27A;
  --color-2: #3B2A1E;
}

Paste it into your stylesheet, then use the colors anywhere: color: var(--color-2);. Rename the variables to something meaningful, like --brand or --text, once you've decided what each color is for.

Color palette from image ideas for small businesses

  • Shop front photo: build your website colors from your real shop, so customers recognise it when they visit.
  • Best-selling product: use its colors for a seasonal campaign or a product page.
  • Packaging: match social graphics to your packaging so posts and parcels look like one brand.
  • Your team photo: a warm, friendly palette for an About page.
  • Seasonal photos: pull an autumn or summer palette from a seasonal photo for a limited campaign, then return to your main brand colors.

Each time, take the color palette from image files you already own, so your graphics stay connected to the real business rather than to stock design trends.

Other image tools

Photo vs logo vs screenshot

The color palette from image results depend a lot on what kind of image you start with:

  • Photos contain gradients, shadows and highlights, so their palettes include several shades of the same color. Ask for 8 to 10 colors, then pick the most useful ones.
  • Logos usually have only a few flat colors, so 5 is often enough, and the colors closely match the original.
  • Screenshots of websites or apps are mostly background, so the largest color is often white or near-white. The smaller shares show the brand and accent colors.

Color palette from image vs a color picker

A color picker, or eyedropper, gives you the exact color of one pixel. That's useful when you need to match a specific spot, but a single pixel can be misleading: in a photo, it may be a slightly lighter or darker shade than the area around it. A color palette from image analysis looks at the whole picture and gives you colors that represent it overall, ranked by how much of the image they cover. For a brand or design palette, that's usually the better starting point.

Naming and recording your palette

Once you've chosen your colors, write them down in one place, such as a simple brand guide, with:

  • a name for each color (for example "Crust brown" or "Cream"),
  • its HEX code for websites and design apps,
  • its RGB values for screen design,
  • what it's used for: text, backgrounds, buttons or accents.

Share the guide with anyone who designs, prints or posts for your business, so every piece uses the same colors.

Accessibility and color

Not everyone sees color the same way. Roughly 1 in 12 men and 1 in 200 women have some form of color vision deficiency, most often difficulty telling red from green. When building a palette:

  • Don't rely on color alone to show meaning, for example in charts or error messages: add labels or icons too.
  • Check text contrast for every text and background pair you plan to use.
  • Test important designs in grayscale to make sure they still work.

A worked example

A bakery has a logo but no color codes, and every new flyer comes out in slightly different browns. The owner uploads the logo PNG and chooses 5 colors. The palette shows a warm caramel, a deep brown and a cream, plus two minor colors from the edges of the lettering. The owner keeps the first three, copies their HEX codes, checks the deep brown on cream in the color contrast checker (it passes for text), and writes all three into a one-page brand guide. Every flyer, post and email template now uses the same colors.

Need more customers from Google?

This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. DeepRit manages Google Ads for small and mid-size businesses, and only Google Ads. We check your account before we ever get on a call, then fix the structure, the keywords, the tracking and the ads, with month-to-month terms and no long contract. Book a free audit call.

Frequently asked questions

How do I get a color palette from image files?

Choose the image in the tool. Its main colors appear instantly as swatches with HEX and RGB codes, largest share first.

How do I find the HEX code of a color in an image?

Upload the image and copy the HEX code of the matching swatch. For one exact pixel, use your device's color picker or a design app's eyedropper.

Is my image uploaded?

No. The image is analysed entirely in your browser and never leaves your device.

Why doesn't a color match a pixel exactly?

Each palette color is the average of a group of similar colors, so it represents that area of the image overall.

Can I use the colors for my brand?

Yes. Pick a few, check text contrast with the color contrast checker, and record the HEX codes in your brand guidelines.

Is the color palette from image tool free?

Yes. It's free with no sign-up and no limits.

Free PPC audit

See where your ad budget leaks.

We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.

Book a free audit call 30-minute call · Free · The audit is yours to keep