# SVG Recolor > Recolor SVG files (icons, logos, illustrations) over HTTP. No API key. Powered by svgray > (grayscale) and svgshift (RGB/HSL color operations). Base URL: https://svg-recolor.jorgenkh.no ## Quick reference - Recolor from a link: `GET https://svg-recolor.jorgenkh.no/api/recolor?url=&color=&mode=` → `image/svg+xml` - Recolor markup: `POST https://svg-recolor.jorgenkh.no/api/recolor` with `Content-Type: application/json` and `{"svg": "", "color": "tomato", "mode": "solid", "format": "json"}` → `{"svg": "...", "palette": [{"from": "#5a9fd4", "to": "#ff6347", "count": 3}], "filename": "..."}` - Recolor a file: `POST https://svg-recolor.jorgenkh.no/api/recolor?color=ff0066` with multipart field `file` - Many files: `POST https://svg-recolor.jorgenkh.no/api/recolor/batch` with multipart fields `files` → ZIP - Just colors: `GET https://svg-recolor.jorgenkh.no/api/map-colors?colors=5a9fd4,306998&color=tomato&mode=colorize` (or `modes=tint,solid,...` for several styles in one call, returned as `mappings`) → `{"mapping": {"#5a9fd4": "#…"}}`. Use this when you already have the colors (design tokens, themes). - List colors: `GET https://svg-recolor.jorgenkh.no/api/palette?url=` or `POST https://svg-recolor.jorgenkh.no/api/palette` (same bodies as above) - Modes and limits: `GET https://svg-recolor.jorgenkh.no/api/modes` - OpenAPI: https://svg-recolor.jorgenkh.no/openapi.json - MCP server (streamable HTTP, no auth): https://svg-recolor.jorgenkh.no/mcp Tools: `recolor_svg`, `list_svg_colors`, `list_recolor_modes`. Claude Code: `claude mcp add --transport http svg-recolor https://svg-recolor.jorgenkh.no/mcp` ## Parameters - `color`: `ff0066`, `#ff0066` (encode `#` as `%23` in URLs), `f06`, `255,0,102`, `rgb(255 0 102)`, `hsl(330 100% 50%)`, or a CSS name like `tomato`. Default `ff0066`. - `mode`: one of `tint`, `colorize`, `hue`, `solid`, `grayscale`, `adjust`. Default `tint`. - `hue`: rotate hue, -360..360 degrees. `saturation`, `lightness`: -100..100 points. Applied after the mode. - `format`: `svg` (default) or `json`. `download`: `true` to get an attachment. - Per-color edits on top of the mode, keyed by the original colors (see `/api/palette`): `replace=5e97f6:ff0000,...` gives single colors their own new color; `hide=ffffff,...` makes colors invisible (shapes stay, painted `none`); `remove=ffffff,...` deletes the shapes painted with them (a shape keeps its stroke or fill when only the other is removed). In JSON and MCP, `replace` is an object and `hide`/`remove` are lists. In the JSON palette, `to` is then `"none"` or `"removed"`. One-color icon (like a devicon "plain" version): `mode=solid&color=000000&remove=ffffff`. - Shapes, canvas and optimizing (the same code as the editor; in JSON and MCP, lists and numbers): - `cut=dce0df,...`: those colors become real gaps (cut through what's below). One path per color, so `mode=solid&cut=...` is one path. For logos with outlines between their parts. Palette `to`: `"cut"`. - `gap=2`: a gap of that width wherever two original colors meet. For logos whose parts just touch. - `line=3`: a line version (like devicon's line icons), only a band of that width along the edges. `lines=outer` draws just the outline (default `all`: also between colors); `keep=ffffff,...` stays filled. - `unit`: `px` (default; the SVG's own units) or `pct` (percent of the icon) for `gap` and `line`. - `canvas=128x128`: a new viewBox size, drawing centered. `place=x,y,scale` moves and scales it; `fit=1` scales and centers the visible drawing (strokes included) with that padding. - `optimize=true`: SVGO 3.3.2 with devicon's settings (precision 3, multipass); `precision=0..8`. - Cut, gaps and lines need flat colors and shapes (no text, images, gradients, masks or transparency). The server gives them 20 s; very complex drawings may need the editor, which has no limit. - Devicon plain version: `mode=solid&color=...&remove=&cut=&canvas=128x128&fit=1&optimize=true`. ## Modes - `tint`: Converts to grayscale, then adds the color. Dark areas take on the color and highlights stay light. This is the classic SVG Recolor look. - `colorize`: Sets every color's hue and saturation to the target color while keeping its lightness, so shading and contrast are preserved. - `hue`: Sets only the hue. Saturation and lightness stay as they were, so muted colors stay muted. - `solid`: Replaces every color with exactly the target color. Best for single-color icons and logos. - `grayscale`: Converts every color to its gray equivalent. - `adjust`: Keeps the original colors and only applies the hue, saturation and lightness shifts. Pick `solid` for single-color icons, `colorize` to keep shading in multi-color art, `hue` to change hue only, `adjust` (with `hue`/`saturation`/`lightness`) to tweak. ## Limits and errors - SVGs up to 2 MB. Links must be public http(s); private and local addresses are refused. - GitHub file links (github.com/.../blob/...) are converted to raw links. - Errors are JSON: `{"detail": "human-readable message"}` with status 400 (bad input), 413 (too large), 415 (not an SVG), 422 (invalid parameter), 429 (rate limited; see the Retry-After header) or 500. - Rate limits per IP: about 60 uploads, link fetches or MCP calls per minute, and 600 /api/map-colors requests per minute. Cached GET responses don't count.