Dominant Color Extraction
Extract dominant colors from an image file using the extract_colors.py script.
Script Usage
code
python ~/.claude/skills/dominant-color/scripts/extract_colors.py <image> [options]
Options
| Flag | Description |
|---|---|
-n, --count N | Number of colors to extract (default: 5) |
-q, --quality 1-10 | Extraction quality, 1=best (default: 1) |
-f, --format FORMAT | Output format: hex, rgb, tuple, full |
--json | Output as JSON |
--dominant-only | Only output the dominant color |
Examples
bash
# Basic usage python script.py image.png # Get 8 colors as hex values python script.py image.jpg -n 8 -f hex # JSON output for programmatic use python script.py image.png --json # Just the dominant color python script.py image.png --dominant-only -f hex
Instructions
- •Run the script with the image path provided by the user:
$ARGUMENTS - •Present the extracted colors clearly
- •If the user needs the colors for code, offer to format them as CSS variables, Tailwind config, or other formats