toololis
Indietro Indietro to Image
🎨

Palette Colori da Immagine — Strumento online gratis

Estrai i colori dominanti da qualsiasi immagine — hex, RGB e HSL

Carica un'immagine ed estrai la palette dei colori dominanti. Ottieni valori hex, RGB, HSL. Esporta come CSS, JSON o swatch. Gratis.

🎨
Drop image here or click to upload
JPG, PNG, WebP, AVIF, GIF, SVG -- up to 10 MB -- never uploaded to server
📚
Scopri di più

Color Palette from Image -- Extract Dominant Colors Instantly

The Strumentoolis Color Palette from Image tool extracts 8 dominant colors from any image using a canvas-based median-cut algorithm. Upload a photo, design mockup, or screenshot and get a complete color palette with hex, RGB, and HSL values. Export as CSS variables, JSON, Tailwind config, or a downloadable swatch image. Everything runs in your browser -- your images are never uploaded to any server.

How the color extraction algorithm works

The tool uses a median-cut color quantization algorithm, a technique originally developed for reducing the number of colors in an image while preserving visual quality. Here is how it works step by step:

  • Pixel sampling -- the image is drawn onto a canvas and every pixel's RGB values are read via getImageData(). For performance, large images are downscaled to 200px width first.
  • Initial bucket -- all pixels start in a single color "bucket" spanning the full RGB range.
  • Median cut -- the bucket with the largest color range is split along its widest axis (R, G, or B) at the median value, creating two new buckets.
  • Repeat -- the splitting continues until the desired number of buckets (8) is reached.
  • Averaging -- each bucket's pixels are averaged to produce a single representative color.
  • Sorting -- colors are sorted by frequency (number of pixels in each bucket) so the most dominant color appears first.

Use cases for image color extraction

  • Design systems -- derive a color palette from brand photography for consistent theming
  • Web design -- extract colors from hero images to create matching backgrounds, borders, and text colors
  • Data visualization -- generate color scales based on source imagery
  • Art and illustration -- analyze color composition in paintings, photography, or film stills
  • Branding -- create mood boards by extracting palettes from inspiration images
  • Accessibility -- identify dominant background/foreground colors to check contrast ratios

Understanding color formats

Each extracted color is displayed in three formats:

  • Hex -- #FF5733 -- the most common format for CSS and web design. 6 hexadecimal digits representing Red, Green, Blue channels (00-FF each).
  • RGB -- rgb(255, 87, 51) -- decimal representation of the same Red, Green, Blue channels (0-255 each). Used in CSS and most programming languages.
  • HSL -- hsl(11, 100%, 60%) -- Hue (0-360 degrees), Saturation (0-100%), Lightness (0-100%). More intuitive for humans -- easy to create lighter/darker variants by adjusting L.

Export format details

The tool supports four export formats to integrate the palette into your workflow:

  • CSS Variables -- ready to paste into your stylesheet: :root { --palette-1: #FF5733; ... }
  • JSON -- array of hex strings for programmatic use: ["#FF5733", "#DAF7A6", ...]
  • Tailwind Config -- extend your tailwind.config.js colors object with the extracted palette
  • Image Swatch -- generates a downloadable PNG image showing all palette colors with hex labels, perfect for sharing or including in design documents

Tips for better color extraction

  • High-quality images -- JPEG compression artifacts can introduce noise colors. Use PNG or high-quality JPG for cleaner results.
  • Crop first -- if you want colors from a specific area, crop the image before uploading to exclude irrelevant regions.
  • Consider background -- a large white or black background will dominate the palette. Crop or mask it out for better results.
  • Multiple images -- extract palettes from several related images and look for common colors to build a cohesive theme.

Median-cut vs. K-means for color quantization

Two popular algorithms for color extraction are median-cut and K-means clustering. Median-cut is deterministic (same input always produces the same output), fast, and splits colors evenly. K-means can produce slightly more perceptually accurate results but is iterative, slower, and non-deterministic. This tool uses median-cut for its speed and reliability in a browser environment.

How to extract a color palette from an image

  1. 1

    Upload an image

    Drag and drop an image onto the upload area, or click to browse. Supports JPG, PNG, WebP, AVIF, GIF, and SVG.

  2. 2

    View extracted colors

    The tool analyzes the image using a median-cut color quantization algorithm and displays 5-8 dominant color swatches.

  3. 3

    Inspect color values

    Each swatch shows hex, RGB, and HSL values. Click any swatch to copy the hex code to your clipboard.

  4. 4

    Export the palette

    Choose an export format: CSS variables, JSON array, Tailwind config, or download as a swatch image.

Frequently Asked Questions

How does the color extraction work?
The tool uses a median-cut color quantization algorithm. It reads every pixel from the image via canvas.getImageData(), groups similar colors into buckets, and splits the largest bucket along its widest color axis. The result is 5-8 representative colors sorted by frequency.
What image formats are supported?
Any format your browser can display: JPG, PNG, WebP, AVIF, GIF, SVG, BMP, ICO. The image is drawn onto an HTML5 canvas element for pixel analysis.
Is my image uploaded to a server?
No. The entire process runs client-side in your browser. The image is read using the FileReader API and drawn onto a canvas. No pixels, no file data, and no metadata leave your device.
Why do I get different colors than I expected?
The algorithm extracts dominant colors by pixel count. A color that covers a large background area will be prioritized even if a small accent color is more visually striking. Very similar colors (e.g., slightly different shades of blue) may be merged into a single representative color.
What export formats are available?
Four formats: CSS Variables (--color-1: #hex;), JSON (array of hex strings), Tailwind Config (extend colors object), and Image Swatch (downloadable PNG with all color blocks and hex labels).
How many colors are extracted?
The tool extracts 8 dominant colors by default. The number of distinct colors depends on the image -- a monochrome photo may produce fewer visually distinct swatches than a colorful illustration.

Punti chiave

  • Color Palette from Image is a free, browser-based image tool — extract dominant colors from any image — get hex, rgb & hsl.
  • No signup, no downloads, no file uploads — your data stays on your device.
  • Works on desktop, tablet, and mobile. Install as a PWA for offline access.

How to Use Color Palette from Image

  1. Open the tool: Launch Color Palette from Image on Strumentoolis — no account or download needed.
  2. Enter your data: Paste text, enter values, or select a file directly in your browser.
  3. Get instant results: Everything is processed locally — results appear immediately.
  4. Copy or download: Save your output or share it. Bookmark for quick access next time.

Color Palette from Image — Quick Facts

Prezzo
Gratis — senza limiti, senza filigrana, senza paywall
Privacy
100% nel browser — nessun dato viene inviato a server
Piattaforma
Qualsiasi browser moderno — desktop, tablet o mobile
Categoria
Image Strumentos on Strumentoolis
Offline
Works offline after first visit (Progressive Web App)
CaratteristicaDettagli
StrumentoColor Palette from Image
CategoriaImage
Registrazione richiestaNo
Caricamento fileNessuno — elaborato nel browser
Supporto mobileCompletamente adattivo
CostoGratis per sempre

Why Use Color Palette from Image?

You should try Color Palette from Image for a quick, private way to extract dominant colors from any image — get hex, rgb & hsl. All processing happens in your browser. Your files and data never leave your device. According to web.dev, client-side processing is the gold standard for privacy.

On the other hand, dedicated APIs or desktop tools suit batch processing better. They also handle server-side automation. For everyday tasks, browser tools offer the best speed, privacy, and convenience.

You might also like

🔒
100% Privacy. Questo strumento funziona interamente nel tuo browser. I tuoi dati non vengono mai caricati su alcun server.