simplify · git:20261016.802bfc5 · 2026-10-16 · sha256 0fedad9d24a6ce1d
simplify git:20261016.802bfc5A
Immutable. This exact content never changes and is served at /api/v1/blob/0fedad9d24a6ce1d.
---
name: simplify
description: "Reduce the number of colors in an SVG using quantization. Triggers on: simplify svg, reduce svg colors, fewer colors, quantize svg, minimize svg colors."
---
# Simplify SVG Colors
Reduce the number of unique colors in an SVG using median-cut quantization.
## Prerequisites
Use the svg.new MCP tools (`mcp__svgnew__*`) if they are available in this session; they need no API key. Otherwise the `SVG_NEW_API_KEY` environment variable must be set. If neither is available, tell the user:
> Connect svg.new with `claude mcp add --transport http --scope user svgnew https://svg.new/api/mcp` and `/mcp` → Authenticate, or generate an API key at https://svg.new/account and set `export SVG_NEW_API_KEY="svk_..."`.
Do not fall back to a local tracer (vtracer, potrace) unless the user asks for one.
## Steps
1. Read the SVG file specified by the user or `$ARGUMENTS`
2. Determine `max_colors` — ask the user if not specified (common values: 2, 4, 8, 16)
3. Call the API:
```bash
curl -s -X POST "${SVG_NEW_API_URL:-https://svg.new}/api/agent/edit/simplify" \
-H "Authorization: Bearer $SVG_NEW_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"svg\": \"$SVG_CONTENT\", \"max_colors\": $MAX_COLORS}"
```
4. The response includes `colors_before`, `colors_after`, and the modified `svg`
5. Report the color reduction to the user
6. Write the simplified SVG to the file
## Notes
- This operation is free (no credits consumed)
- `max_colors` range: 1–256
- Similar colors are merged together; distant colors stay distinct
- Shapes with `fill="none"` are not affected