PUBLIC.INTERNET

Palette Thief Generator

Upload an image and the tool pulls out a palette of 3 to 10 dominant colors, shown as swatches sorted from lightest to darkest. Pick the output format that matches where the colors are headed: a Tailwind config block, CSS custom properties, plain hex or rgb() lines, or a JSON array. Click any swatch to copy its hex. The image is decoded in your browser and never uploaded, so unreleased mockups stay on your machine.

Drop Inspiration Image Here

or click to browse

5 colors

How It Works

  • 1. Upload an image (logo, photo, design mockup)
  • 2. Canvas API analyzes pixel data using k-means clustering
  • 3. Extracts dominant colors and generates code
  • 4. Copy-paste directly into your project

How to extract a palette

  1. Drop a photo or mockup on Drop Inspiration Image Here, or click that box to browse. A preview of the image appears below it.
  2. Set Number of Colors with the slider, from 3 to 10. Five is the default.
  3. Choose an Output Format: Tailwind CSS Config, CSS Variables, Hex List, RGB Values, or JSON Array. The Tailwind option is a v3-style tailwind.config.js block; in Tailwind v4, put the colors in @theme instead.
  4. Press Extract Palette. Swatches appear with their hex codes, and the code box fills in.
  5. Press Copy Code for the whole block, or click a single swatch to copy only its hex. Run it again for a slightly different result.

What k-means does to your pixels, and why runs differ

The tool shrinks the image to at most 800 pixels on its longest side, samples every tenth pixel, and treats each sample as a point in RGB space. K-means then places k starting centers at random sample points and repeats 30 times: assign every point to its nearest center, move each center to the average of its points. The final centers are your palette. Because it averages, a center can be a color that never appears exactly in the photo.

The random starting points mean two runs on the same image can give slightly different palettes, especially at higher counts. Distance is measured in plain RGB, which does not match human color perception, so two colors that look alike to you may be split while a dull gray cluster takes a slot. Swatches are sorted by the simple mean of red, green, and blue, not by how often each color appears. Transparent areas of a PNG are read as black, so a logo on transparency usually gets a black swatch.