A browser-based tool for extracting color palettes from images. Runs client-side with no external dependencies, supporting custom palette sizes, color sorting, swatch editing, and multi-format export.
Use the hosted version directly in your browser here.
Download Img2Palette.html from the repository root and open it in any browser.
git clone https://github.com/meangrinch/Img2Palette.git
cd Img2Palette
python scripts/build.py- Extraction: Extract up to 256 colors (never more than the image holds) from images with Wu, K-Means++, or Median Cut, preserving small accent colors
- Sorting: Order palettes into smooth color gradients while preserving locked swatches
- Organization: Arrange swatches by hue spectrum or lightness with separated neutral tones
- Swatch Editor: Click to copy hex codes, lock favorite colors, edit or remove swatches, and sample new ones with the eyedropper
- Preview: Compare the image and palette with a side-by-side view, palette-only view, eyedropper loupe, pixel grid overlay, and up to 3200% zoom, with touch panning and pinch-zoom on phones and tablets
- Export: Save as PNG swatches (strip, grid, or preview layout, with optional hex labels), JSON, GPL, CSS variables, or hex lists, or copy to the clipboard
Img2Palette is open-source and free. If it saves you time or enhances your workflow, consider supporting its development!


