Uttir
By Uttir 5 min read

How to Make a Color Palette from a Photo (and Why You Should)

A photo is a great source for a color palette — the colors already work together. This guide covers the visual approach, the algorithmic approach, and the right tools for designers and developers.

A color palette from a photo is a small set (usually 4-6 colors) sampled from the image that work together. The visual approach: zoom in, pick 4-6 colors with the eyedropper, write down the hex codes. The algorithmic approach: use a color-quantization algorithm (median cut, k-means) to find the dominant colors automatically. The Uttir Color Picker from Image is the eyedropper; the Color Palette Generator does the algorithmic sampling.

A color palette from a photo is one of the most reliable ways to get colors that work together. The photo already has a color story — the time of day, the location, the mood — and the colors are already balanced by the photographer. Sample 4-6 of them and you have a palette that is both cohesive and specific.

Two approaches: visual and algorithmic

Visual (eyeball + eyedropper)

Open the photo, zoom in, and use a color picker to grab the colors that catch your eye. The visual approach is fast (5 minutes) and gives you the colors that make the photo feel the way it does — the accent, the highlight, the shadow. The risk: your own bias. You tend to pick colors you already like, which means the palette is not a discovery, it is a confirmation.

Algorithmic (quantization)

A color-quantization algorithm (median cut, k-means, octree) finds the dominant colors in the image. The dominant colors are the ones that take up the most pixels. The algorithmic approach is fast (seconds) and gives you the colors that actually make up the photo, regardless of your taste. The risk: the dominant color is often "background" — sky, wall, water — which may not be the colors you want in your palette.

The right answer is usually both. Start with the algorithmic output (5-6 dominant colors), then edit down to the 4-5 that fit your purpose. The Uttir Color Picker from Image gives you the eyedropper; the Color Palette Generator does the algorithmic sampling.

How many colors do you need?

The standard rules for design palettes:

  • 3 colors — a single primary plus two supporting colors. Good for minimal brands, small products, landing pages.
  • 4-5 colors — a primary, a secondary, a neutral (often grey or off-white), and 1-2 accents. The sweet spot for most apps and websites.
  • 6-8 colors — adds semantic colors (success, warning, error) and shades (light, default, dark of each base). Right for design systems.

More than 8 and you have a library, not a palette. Resist the urge to keep adding "just one more" — every color in a palette is a decision you have to defend.

Step 1: Pick a photo that has the right mood

Not every photo makes a good palette. A good source photo:

  • Has 3-7 distinct colors (not 50).
  • Has colors that you can name without thinking hard (a forest, a sunset, a city, a kitchen).
  • Is well-lit, so the colors are not crushed to black or blown out to white.
  • Has a focal point — the eye should land somewhere, and the colors around that point are the ones you want.

Photos with too many colors (a market, a city street, a crowd) do not yield clean palettes. Photos with too few (a flat-color wall, a sky) yield a palette of one. The sweet spot is a scene with a clear subject and a clear context.

Step 2: Sample the colors

Open the photo in the Uttir Color Picker from Image:

  1. Drop the image onto the upload zone.
  2. Click anywhere on the image. The magnifier zooms in so you can target a single pixel.
  3. The HEX, RGB, and HSL values appear in the panel.
  4. Click "Add to palette" to save the color. Repeat 4-6 times.
  5. Export the palette as JSON (for code) or CSS variables (for stylesheets).

What to look for as you click:

  • The background color — usually takes up 50%+ of the image. This is your "neutral" (or your "primary", depending on the design).
  • The dominant accent — the color of the focal point. This is usually the brand color.
  • One or two supporting colors — from objects in the foreground.
  • A highlight or shadow tone — for depth. This is usually near-white or near-black.

Step 3: Test accessibility

Once you have a palette, run the contrast check. The Uttir Contrast Checker shows the WCAG contrast ratio between any two colors:

  • 4.5:1 — minimum for body text (AA).
  • 3:1 — minimum for large text (AA) and UI components (AA).
  • 7:1 — for body text at AAA.

Most photo-derived palettes fail this check on first try. That is normal — natural photos have low-contrast color combinations (think fog, dusk, or pastel walls). You usually need to either lighten or darken one of the colors, or pick a different photo. Do not skip this step: a beautiful palette that fails contrast is unusable for a website.

Step 4: Build the palette in a design system

A palette is a set of colors. A design system is a palette plus shades plus semantic roles. The minimum viable design system has 3 colors × 3 shades (light, default, dark) plus 2 semantic colors (success, error). That is 11 colors total. Most apps need more (warning, info, hover states, focus states), but 11 is a starting point.

For each base color, generate the shades with HSL: hold H and S constant, vary L. Light = L+20%, dark = L-20% (or more aggressive if the base is mid-tone).

Algorithmic color extraction

For algorithmic extraction, the standard algorithms are:

  • Median cut — recursively splits the color space into halves along the median of one channel. Fast, reasonable quality. Used in most "extract dominant colors" libraries.
  • K-means — clusters pixels into k colors. Better quality but slower.
  • Octree — builds a tree of color buckets, merges small buckets into the nearest. Very fast, good for large images.
  • Color thumbnail — resize the image to NxN pixels, treat each pixel as a color. Crude but extremely fast and surprisingly good for most photos.

The Uttir Color Palette Generator uses the color-thumbnail approach: it resamples the image to a small grid, counts the unique colors, and returns the most common ones. It is the right tool for "give me the dominant 5 colors" in seconds.

Common pitfalls

Picking the same color twice

Two colors in a palette should be visually distinct. If the hex codes are within 10-15 of each other in any channel, they are probably the same color to the eye. Drop one of them.

Skipping the neutral

Every palette needs a neutral — usually a light grey for backgrounds, a dark grey for body text, and a mid-grey for secondary text. Photo-derived palettes often lack a neutral because nature rarely has "pure" greys. Add one (off-white like #FAFAFA and a soft dark like #1F2937) and the palette becomes usable.

Forgetting the dark mode

If the photo is bright (a beach, a kitchen), the palette will skew light. Invert the lightness for dark mode. Most modern design systems ship every color in three shades (50, 500, 900) so the dark mode just picks different stops.

Beyond the photo: building palettes from non-photo sources

Photos are the best source for "mood" palettes. For other types of palettes, the source is different:

  • Type-driven palettes — start with one color (often a brand color) and build the rest around it using color theory (complementary, triadic, split-complementary).
  • Cultural palettes — sample from a reference (a flag, a national dress, a landscape). Useful for products targeting a specific region or audience.
  • Material Design palettes — start from one of the predefined Material palettes and customize the shades.
  • Tailwind palette — use Tailwind's defaults (slate, gray, zinc, etc.) and pick a 500-shade as the base.

For all of these, the Uttir Color Palette Generator and Color Picker from Image are the building blocks.

Bottom line

A photo-derived palette is fast, cohesive, and specific. Sample 4-6 colors, test the contrast, add a neutral if needed, and you have a palette that works. The Uttir Color Picker from Image is the eyedropper, the Color Palette Generator is the quantizer, and the Contrast Checker makes sure the palette is usable. All three run in your browser, no upload, no tracking.

#color#design#branding#palette#design-tools

New tools and guides, once a week

One short email when something new ships. No tracking, no images, unsubscribe with one click.