This manual explains how to use Shapearator through both the desktop GUI and the CLI.
Shapearator extracts individual icons from a larger icon sheet and exports each icon as one or more files on a common canvas. It is designed for hand-drawn UI icon sheets, symbol collections, and mixed icon boards where icons are spatially separated enough to detect cleanly.
Typical use cases:
- splitting a sketch sheet into per-icon assets
- generating
PNG,JPG,TIFF, andSVGexports in one run - normalizing icon sizes to a shared canvas
- creating metadata for asset catalogs
- assigning semantic filenames with a local Ollama vision model
Make sure the following are available:
- Python environment with the app dependencies installed
inkscapeonPATHpotraceonPATH
If you want semantic naming:
- a running local Ollama instance
- a local Ollama model selected in the app or CLI
Supported input formats:
PNGSVG
- Launch the app with
./run.shorpython main.py. - Open the
Workspacetab. - Choose an input sheet.
- Choose an output folder.
- Select your export formats.
- Set the output canvas size.
- Choose a canvas behavior.
- Click
Extract Icons.
python shapearator.py sheet.png --output-dir exportsThis runs extraction using default settings and writes results into exports/.
The GUI is split into two tabs:
WorkspaceSettings
The Workspace tab is where extraction runs happen.
Source section:
Input Sheet: path to the sourcePNGorSVGOutput Folder: destination for generated assets- provider summary line: shows the currently active provider mode
Detection section:
Padding: adds space around each extracted icon cropMin Area: removes tiny detections such as dust or accidental marksMerge: reconnects nearby strokes into one icon groupPreset: loads one of the built-in detection presets
Output Studio section:
Formats: choose any combination ofPNG,JPG,TIFF, andSVGWidthandHeight: define the final export canvas sizeBitmap Export: choose how bitmap backgrounds should behaveCanvas Behavior: choose how icons are scaled onto the common canvas
Run section:
Extract Icons: starts the extraction pipeline- status line: shows the current run state
- progress bar: shows extraction progress across phases
Preview section:
- shows a preview of the selected extracted icon
- reflects either a bitmap export or a preview generated from
SVG
Extracted Items section:
- lists every exported icon
- shows formats, source size, and canvas size
- selecting an item updates the preview
The Settings tab configures local provider behavior.
Provider options:
Geometry Only: extraction only, no semantic namingOllama Local: local Ollama provider for semantic namingModel Directory: local model catalog selection for future adapters
Ollama settings:
Ollama URL: must be local-onlyOllama Model: selected local modelRefresh Ollama Models: rescans local modelsUse Recommended: picks the app’s preferred local vision model when available
Directory settings:
Model Directory: local folder used to discover modelsDirectory Model: selected item from that folder
Semantic naming:
Use selected model for semantic file naming and metadata when supported
The CLI uses the same shared extraction engine as the GUI.
Basic shape:
python shapearator.py INPUT --output-dir OUTPUT [options]--output-dir--formats--output-width--output-height--canvas-mode--bitmap-export-mode--padding--min-area--merge-gap
--provider--ollama-url--ollama-model--local-model-root--local-model-name--semantic-naming--no-semantic-naming
--use-config--save-config
--detection-preset
Supported preset names:
BalancedTiny DetailsLoose SketchesBold Shapes
Preset precedence:
- If
--use-configis set, load config values first. - If
--detection-presetis set, apply the preset values next. - If explicit
--padding,--min-area, or--merge-gapvalues are provided, they override both config and preset values.
Geometry-only run:
python shapearator.py sheet.png \
--output-dir exports \
--provider geometry \
--formats png svgRun with config defaults:
python shapearator.py sheet.svg \
--use-config \
--output-dir exportsRun with preset and explicit override:
python shapearator.py sheet.png \
--output-dir exports \
--detection-preset "Loose Sketches" \
--min-area 180Run with local Ollama semantic naming:
python shapearator.py sheet.png \
--output-dir exports \
--provider ollama \
--ollama-url http://127.0.0.1:11434 \
--ollama-model qwen2.5vl:3b \
--semantic-namingoriginal
- keeps the isolated icon at its extracted size
- best when you want raw relative differences preserved
uniform_to_largest
- scales the largest icon to fit the canvas
- applies the same scale to all icons
- best when the set should feel visually consistent
individual_fit
- scales each icon independently to fit the canvas
- best when every icon should use maximum available space
keep_background
- fills the bitmap canvas with the detected source background
- useful when the original sheet background matters
transparent_preserve_interior
- exports with transparency
- tries to preserve internal white or light details
- usually the best choice for reusable icon assets
Padding
- adds breathing room around the extracted symbol
Min Area
- filters out small detections
- lower values catch finer details but may also keep noise
Merge Gap
- reconnects nearby strokes into one symbol group
- higher values help with sketchy, broken marks
Use PNG input when:
- the source is a scanned or exported bitmap sheet
- icons are clearly separated
- you want geometry-based local extraction
Use SVG input when:
- the sheet is already vector
- you want the cleanest possible
SVGoutputs - you want grouped vector extraction rather than raster tracing
In general, SVG input gives the highest-quality downstream vector exports.
Semantic naming is optional and local-only.
How it works:
- extraction runs normally
- preview images are generated per icon
- the selected local Ollama model is asked to identify each icon
- labels are converted into filesystem-safe slugs
- exported files are renamed to the semantic label
- metadata is updated with label, tags, and confidence
Important behavior:
- semantic naming currently runs only when
provider=ollama - the Ollama URL must be local
- duplicate names are disambiguated with numeric suffixes
- if semantic identification fails, extraction still completes
A typical run may produce:
exports/
png/
jpg/
tiff/
svg/
metadata/
Only selected formats are created.
Each icon’s metadata JSON may include:
- label and tags
- confidence
- source bounds
- source size
- canvas size
- pipeline/provider information
- model used
- dominant color and palette
- vector mode
- exported file paths
The app stores settings in:
config/settings.json
GUI behavior:
- loads automatically on startup
- saves automatically when settings change
CLI behavior:
- ignores config unless
--use-configis passed - saves config only when
--save-configis passed
This makes CLI runs safe for automation without unexpectedly changing your defaults.
Input file not found
- confirm the path exists
- confirm the file extension is
.pngor.svg
At least one export format must be selected
- pass one or more values to
--formats - or use config values with
--use-config
Canvas width and height must be positive integers
- set both dimensions above zero
Ollama provider requires a local endpoint
- use
localhost,127.0.0.1, or::1 - do not point to remote or cloud endpoints
Very small icons are not being detected:
- lower
Min Area - try
Tiny Details
Icons are being merged incorrectly:
- lower
Merge Gap - increase
Min Areaif noise is being grouped
Single icons are being split into multiple pieces:
- increase
Merge Gap - try
Loose Sketches
Vector output looks rasterized:
- start from
SVGinput when possible - note that colored raster sources may be embedded in
SVGto preserve fidelity
For clean monochrome icon sheets:
- preset:
Balanced - canvas mode:
uniform_to_largest - bitmap export mode:
transparent_preserve_interior
For tiny or delicate symbols:
- preset:
Tiny Details - lower
min-areaif needed
For broken sketch lines:
- preset:
Loose Sketches - increase
merge-gapif needed
For bold geometric shapes:
- preset:
Bold Shapes - keep
uniform_to_largestunless every icon should fill the frame independently