हिं हिन्दी

    Color palette extractor

    Get the 2–12 main colours of an image as HEX, RGB or CSS.

    or drop image here

    Files never leave your device

    About this tool

    This tool finds the main colours of an image and shows each one with its HEX code, RGB value and share of the picture. It groups similar pixels with k-means clustering, so you can choose from 2 to 12 colours and get the same palette every time for the same image. Copy the codes, or download the palette as CSS variables or a PNG swatch.

    At a glance

    What it does
    Get the 2–12 main colours of an image as HEX, RGB or CSS.
    Price
    Free, no sign-up
    Works in
    Your browser, on phone or computer. Works offline after the first visit.
    Privacy
    Files are processed on your device and never uploaded.
    Method
    k-means clustering in RGB, deterministic seeding
    Colours
    2 to 12, sorted by share of pixels
    Export
    HEX, RGB, CSS custom properties, PNG swatch

    How to extract a colour palette from an image

    1. Select or drop a photo, logo or screenshot.
    2. Move the "Number of colours" slider until the palette looks right.
    3. Copy a HEX or RGB code, copy the CSS variables, or press "Download palette PNG".

    Private

    Your files are processed in your browser and never uploaded.

    Fast

    No upload or queue. Results are ready in seconds.

    Free

    No sign-up, no limits and no watermark on your files.

    Frequently asked questions

    How are the palette colours chosen?

    By k-means clustering: every visible pixel is grouped with the nearest of k colours, and each colour moves to the average of its group until nothing changes. The percentage is the share of pixels in each group. Example: an image that is half yellow #f0c81e, 30% blue #1428a0 and 20% white #fafafa gives exactly those three colours at 50%, 30% and 20% when you ask for 3 colours.

    How is this different from the colour picker?

    Color Picker from Image gives the exact colour of one pixel you tap. This palette tool summarises the whole image into a few representative colours, which suits brand colours, themes and design moodboards.

    How do I use the CSS variables?

    Copy the :root block into your stylesheet and use the colours with var(), for example color: var(--palette-1). The variables are numbered from the most to the least common colour.

    Are my files uploaded to a server?

    No. This tool runs entirely inside your browser, so your files never leave your device. Nothing is stored or seen by us.