brandkit process
Full SVG processing pipeline with all options.
Synopsis
Description
Process an SVG file through the complete pipeline:
- Remove background — Remove full-bleed background elements (if
--remove-background) - Convert colors — Convert to target color (if
--colorspecified) - Center content — Analyze and fix viewBox for optimal centering (if
--center) - Verify vector — Ensure output is pure vector, no embedded raster (if
--strict)
Flags
| Flag | Description |
|---|---|
-o, --output |
Output file path (required) |
-c, --color |
Target color (hex or name) |
--remove-background |
Remove full-bleed background rect/circle |
--include-stroke |
Also convert stroke colors |
--center |
Auto-fix viewBox for centering |
--strict |
Fail on embedded binary (default: true) |
-h, --help |
Help for process |
Examples
Full processing pipeline:
Remove background and convert:
Center without color conversion:
Pipeline Steps
1. Background Removal
When --remove-background is specified, the following elements are removed:
- Full-bleed
<rect>elements (covering entire viewBox) - Full-bleed
<circle>elements - First child elements that appear to be backgrounds
2. Color Conversion
When --color is specified, all fill and stroke colors are converted:
- Hex colors (
#ffffff,#fff) - RGB colors (
rgb(255,255,255)) - Named colors (
white,black)
Mask and clipPath elements are preserved by default.
3. Centering
When --center is specified:
- Calculates content bounding box
- Adjusts viewBox for optimal centering
- Adds equal padding on all sides
4. Verification
When --strict is specified (default: true):
- Detects embedded base64 images
- Detects data URIs
- Detects binary references
- Fails if any embedded raster data found