simplify ยท diff

git:20261016.f908cbd to git:20261016.8dbae0f

12 added, 25 removed. Audit A to A.

---
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
+ Reduce the number of distinct colors in an SVG with median-cut quantization.
- Use the svg.new MCP tools if they are available in this session (`mcp__svgnew__*`, or `mcp__plugin_svg-vectorizer_svg-new__*` when this plugin provides them); 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_..."`.
+ ## Before you start
- Do not fall back to a local tracer (vtracer, potrace) unless the user asks for one.
+ Use the svg.new MCP tools from this plugin (named `mcp__plugin_svg-vectorizer_svg-new__*`, or `mcp__svgnew__*` if the user connected the server directly). They sign in with the user's svg.new account, so no API key is involved. If the tools are missing or say sign-in is needed, ask the user to run `/mcp`, pick the svg.new server and choose **Authenticate**.
- Large inputs go by reference: `svg_url` for the SVG (e.g. the download link a previous result gave), `image_url` or `upload_id` (from `create_upload`) for rasters, each up to 20 MB; large results come back as one-hour download links.
## 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
+ 1. Read the SVG named in the request or `$ARGUMENTS`.
+ 2. Decide `max_colors`. Ask the user if they didn't say; 2, 4, 8 and 16 are common.
+ 3. Call `simplify_svg` with `max_colors` and the SVG, as `svg` (the file's text) or `svg_url` (a public link, such as a download link from an earlier result).
+ 4. Report the color count before and after.
+ 5. Write the simplified SVG to the file. If it came back as a download link, save it with `curl -sL -o <file> "<link>"`.
## 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
+ - Free: no credits are used.
+ - `max_colors` can be 1 to 256.
+ - Similar colors merge; distant colors stay distinct. Gradient stops are reduced too.
+ - Shapes with `fill="none"` are not affected.