Created by Charis Tsevis.
Current version: 0.3.2
Shapearator exists to solve a common asset-preparation problem: taking a single file that contains many shapes or icons, identifying each individual shape, separating it cleanly, and cataloging the results into well-organized, individually named files. Instead of manually cropping, renaming, and sorting every asset by hand, Shapearator automates that workflow and produces structured exports with metadata.
Shapearator is a local-first Python app for extracting individual icons from hand-drawn icon sheets. It supports both a desktop GUI and a feature-rich CLI, works with PNG and SVG input sheets, and exports cleaned icons as PNG, JPG, TIFF, and SVG with per-icon metadata.
- Detects isolated icons from raster or vector sheets
- Normalizes exports to a shared output canvas
- Supports multiple canvas scaling behaviors
- Exports bitmap and vector formats in one run
- Writes per-icon metadata JSON files
- Optionally uses local Ollama vision models for semantic file naming
- Keeps the workflow local-only and offline-friendly by design
Shapearator currently has two supported interfaces:
- GUI desktop app: best for visual workflows, previews, and settings management
- CLI: best for automation, scripting, and repeatable batch runs
- macOS packaged app: available upon request
GUI-only features:
- live preview
- extracted item browser
- file/folder picker dialogs
- light/dark appearance toggle
CLI parity covers extraction, export, metadata, settings, provider selection, semantic naming, and progress reporting.
Shapearator for macOS includes a native desktop workspace for local extraction and export workflows.
The macOS build also includes a native settings experience for local providers, Ollama configuration, and model management.
Distribution note:
- a packaged macOS
.dmgexists separately from this repository - the current installer is approximately
1.8 GB, so it may be impractical to distribute directly through GitHub in-repo - the macOS build is available upon request
Input formats:
PNGSVG
Export formats:
PNGJPGTIFFSVG
Python dependencies used by the app include:
Pillowopencv-pythonnumpyrequests
System tools required by parts of the pipeline:
inkscapepotrace
Notes:
SVGinput is the highest-fidelity route when available.- Raster-to-
SVGoutput is generated differently depending on the icon content:- monochrome shapes can be traced to vector paths
- colored or non-monochrome content may be embedded as raster inside
SVG
Start the desktop app from the repository root:
./run.shYou can also launch it directly with Python:
python main.pyBasic usage:
python shapearator.py sheet.png --output-dir exportsShow all CLI options:
python shapearator.py --helpThe CLI supports:
- provider selection:
geometry,ollama,directory - output formats and canvas sizing
- canvas behavior selection
- bitmap export mode selection
- detection presets
- direct detection parameter overrides
- optional config loading from
config/settings.json - optional config persistence back to
config/settings.json - local Ollama semantic naming
Example: geometry-only extraction
python shapearator.py sheet.png \
--output-dir exports \
--formats png svg \
--output-width 512 \
--output-height 512 \
--canvas-mode uniform_to_largestExample: use a detection preset and override one value
python shapearator.py sheet.png \
--output-dir exports \
--detection-preset "Tiny Details" \
--merge-gap 11 \
--formats png jpg svgExample: semantic naming with local Ollama
python shapearator.py sheet.png \
--output-dir exports \
--provider ollama \
--ollama-url http://127.0.0.1:11434 \
--ollama-model qwen2.5vl:3b \
--semantic-naming \
--formats png svgExample: load defaults from config and save the resolved run settings
python shapearator.py sheet.svg \
--use-config \
--save-config \
--output-dir exportsCanvas modes:
original: keep each isolated icon at its original extracted size on the common canvasuniform_to_largest: scale the largest icon to fit, then apply the same scale to all iconsindividual_fit: scale each icon independently to fit the canvas
Bitmap export modes:
keep_background: preserve the detected original background color in bitmap outputstransparent_preserve_interior: export transparent bitmaps while preserving internal light details when possible
Detection presets:
BalancedTiny DetailsLoose SketchesBold Shapes
Explicit --padding, --min-area, and --merge-gap values override the preset if both are provided.
Provider modes:
geometry: classical local extraction onlyollama: local Ollama endpoint for semantic namingdirectory: local model catalog selection stored in settings for future adapters
Important constraints:
- Ollama must point to a local endpoint such as
http://127.0.0.1:11434 - cloud endpoints are intentionally out of scope
- semantic naming is currently active only with
provider=ollama - the directory provider is exposed for local model organization and selection, but it is not yet a direct inference backend
Recommended local Ollama models currently referenced by the app:
qwen2.5vl:3bminicpm-v:latestmoondream:latestllava:7b
Each extraction run writes an output directory containing only the selected export folders plus metadata:
exports/
png/
jpg/
tiff/
svg/
metadata/
Each metadata file contains information such as:
- exported file paths by format
- source bounds and source size
- output canvas size
- provider and model details
- vector export mode
- dominant color and palette
- semantic label, tags, and confidence when available
User settings are stored in:
config/settings.json
This file can hold defaults for:
- provider selection
- Ollama URL/model
- local model directory selection
- semantic naming
- default formats
- output dimensions
- canvas mode
- bitmap export mode
- detection parameters
- last used input and output locations
The GUI reads and writes this automatically. The CLI uses it only when --use-config is supplied, and saves it only when --save-config is supplied.
main.pyis the GUI entrypointshapearator.pyis the CLI entrypointrun.shlaunches the GUI from the repository rootservices/contains the shared extraction engine and settings logicgui/contains the desktop interface- much of
docs/contains sample inputs, outputs, and working assets rather than source code
For a full user guide, see MANUAL.md. For a repository map, see FILE_STRUCTURE.md.
- The app expects icon sheets where symbols are reasonably separated.
- GUI preview is available only in the desktop app.
- The directory provider does not yet perform direct inference.
- Some raster-to-vector exports may remain embedded-raster
SVGwhen tracing would lose fidelity.
Required binary 'inkscape' was not found on PATH.: installinkscapeand ensure it is available on your shellPATH.Required binary 'potrace' was not found on PATH.: installpotraceand ensure it is available on your shellPATH.Ollama provider requires a local endpoint...: point--ollama-urltolocalhost,127.0.0.1, or::1.- Very small marks are disappearing: lower
min-areaor try theTiny Detailspreset. - Multiple strokes are being split apart: raise
merge-gapor try theLoose Sketchespreset. - Exports feel inconsistent in scale: use
uniform_to_largestfor a shared visual scale across the set.
This project is released under the MIT License. See LICENSE.
