Home › Image Tools › Color Palette from Image

Color Palette from Image

Upload a photo, artwork or screenshot and instantly get its dominant colors. Choose how many colors you want, compare two extraction methods, then copy the HEX codes, CSS variables or Tailwind colors, or download the palette as an image.

Last updated:

    Advertisement
    Advertisement

    How to use the Color Palette from Image

    1. Add an image: drop it on the box, paste it with Ctrl+V, or press Choose image. A sample photo is loaded so you can try the tool right away.
    2. Pick the number of colors (3 to 12) with the slider. The palette updates instantly.
    3. Choose a method: K-means finds the colors that best represent the whole image; Median cut is faster and keeps more small accent colors.
    4. Copy the colors: click a swatch to copy its HEX code, or choose a code format and press Copy code.
    5. Download the palette as a PNG image to share it or keep it as a mood board.

    K-means vs median cut

    K-means (Lab)Median cut (RGB)
    How it worksStarts from well-spread seed colors (k-means++), then repeatedly assigns every pixel to the nearest color and moves each color to the average of its pixels until nothing changes.Puts all colors in one box, then keeps cutting the box with the most pixels (later: most pixels × widest spread) in half at the median of its widest channel.
    Color distanceCIELAB, designed so equal distances look roughly equally different to the eyeRGB channel ranges
    StrengthColors that best represent the image as a whole; stable, balanced palettesKeeps small but distinct accent colors, such as a red flower in a green field
    Best forPhotos, brand palettes from product shots, mood boardsIllustrations, posters, logos and images with a few strong accents

    Both methods analyze a scaled-down copy of up to about 40,000 pixels, which is plenty to capture the color distribution while keeping results instant. Results are deterministic: the same image and settings always give the same palette.

    Turning an image palette into a usable color scheme

    • Pick a dominant and a neutral. The color with the largest share is often a background or sky. Pair it with the darkest or lightest neutral for text.
    • Check contrast before using colors for text. WCAG asks for a contrast ratio of at least 4.5:1 for normal body text and 3:1 for large text.
    • Use accents sparingly. A common rule of thumb is 60% dominant color, 30% secondary color and 10% accent.
    • Need more shades? Paste a HEX code into a shades or Tailwind color generator to build a full 50 to 900 scale from one extracted color.

    Frequently asked questions

    How does the tool find the main colors of an image?

    It reads the pixels of a scaled-down copy of your image and groups similar colors together. With k-means, colors are clustered in the CIELAB color space, which matches human color perception better than RGB, and each cluster's average becomes one palette color. Median cut repeatedly splits the set of colors along its widest channel until there are as many boxes as colors you asked for.

    Is my image uploaded?

    No. The image is opened and analyzed entirely in your browser with the Canvas API. Nothing is sent to a server, so it is safe for private photos and unreleased designs.

    Why are the colors slightly different from a single pixel I pick?

    Each palette color is the average of a whole group of similar pixels, so it represents an area of the image rather than one exact pixel. To read the exact color of one spot, use an image color picker instead.

    What do the percentages mean?

    They show what share of the image's pixels belong to each color group. A background color usually has the largest share, while small accent colors may have only 1 to 3%.

    How many colors should I extract?

    For a website or brand palette, 5 or 6 colors is a good start: one or two dominant colors, a neutral and a few accents. Use 8 to 12 colors to capture more detail from colorful illustrations.

    Are transparent pixels counted?

    No. Pixels that are mostly transparent (alpha below 50%) are ignored, so logos and icons on a transparent background give a palette of only their visible colors.

    Are all the tools on FreeToolCabin tested for quality and accuracy?

    Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

    Related tools

    Image Color PickerPick any pixel colour from an image and get HEX, RGB, HSL plus a paletteColor Palette GeneratorGenerate beautiful color palettes and export them.Color Name FinderFind the closest color name for any HEX or RGB color.HEX to RGBConvert HEX colors to RGB and other formats.HEX to PantoneFind the 5 closest Pantone-style solid coated colors for any HEX or RGB, ranked by Delta E.PSD to PNGConvert Photoshop PSD files to PNG and export every layer as its own PNG, no Photoshop needed.RGB to HEXConvert RGB to HEX with sliders, live swatch and one-click copy.HEX to HSLConvert HEX colors to HSL and back with interactive sliders.RGB to CMYK ConverterConvert RGB and HEX colors to CMYK for print, and back.Color Contrast CheckerCheck WCAG contrast ratios and find accessible text colors.Pantone to HEXLook up approximate HEX, RGB and CMYK values for Pantone colors.Color Blindness SimulatorSee any image as people with protanopia, deuteranopia, tritanopia or achromatopsia see itColor Shades GeneratorTurn one HEX color into a 50-950 scale plus tints, shades and tones, ready to export.Tailwind Color GeneratorTurn one color into a full Tailwind 50–950 shade scale and export the config or CSS.Color MixerMix two colors in sRGB, linear, OKLab or OKLCH, or blend them with Photoshop-style modes.Random Color GeneratorGenerate random HEX colors one at a time or in batches, with hue, saturation and lightness ranges.Color WheelFind complementary, triadic, analogous and other color harmonies on an interactive wheel.Color PickerPick any color and get HEX, RGB, HSL, HSV and CMYK codes, shades and a screen eyedropper.HTML Color CodesAll 140 HTML color names with HEX and RGB codes, plus the 216 web-safe colors. Click to copy.Replace Color in ImageClick a color in a picture and swap it for a new color or transparency, keeping the shading.CMYK to RGBConvert CMYK percentages to RGB and HEX color codes with sliders and a live preview.HSL to HEXConvert HSL and HSLA colors to HEX and RGB with sliders and a live preview.HEX to RGBAConvert HEX color codes to CSS rgba() with an opacity slider and one-click copy.RGBA to HEXConvert rgba() colors to 8-digit HEX, or flatten transparency onto any background.HEX to CMYKConvert HEX color codes to CMYK percentages for print, with a live preview.Color Temperature to RGBConvert a color temperature in kelvin (1000-40000 K) to RGB and HEX with a live swatch.OKLCH Color ConverterConvert HEX, RGB and HSL to OKLCH, OKLab, Lab and LCH with sRGB and P3 gamut checks.RAL to HEXLook up RAL Classic codes as HEX, RGB and CMYK, search by name or find the nearest RAL.RGB to HSLConvert RGB values to HSL, HSV and HWB with a live swatch and copy-ready CSS.Color Code ConverterConvert a color between HEX, RGB, HSL, HSV, CMYK, LAB, LCH and OKLCH with a live swatch.Room Paint Color VisualizerUpload a room photo, select the walls and preview any paint color or HEX with real lighting.Photo to Pop ArtMake Warhol-style pop art from a photo: posterized color tiles in 1, 4 or 9 grids with custom palettes.Screen Color PickerPick any pixel color from anywhere on your screen and copy it as HEX, RGB or HSL.Solid Color Image GeneratorMake a plain single-color or transparent image in any size, like 1920x1080, as PNG or JPG.White Balance CorrectorFix color casts: click a neutral gray point or use auto gray world, then fine-tune temperature and tint.CMYK to HEXConvert CMYK percentages to a HEX color code and RGB, with a live swatch and shades.Photo Color MatchCopy the color grading of a reference photo onto your image (Reinhard color transfer).Underwater Photo Color CorrectionRestore lost reds and remove the blue or green cast from underwater photos by depth.
    See all 38 Color Tools →