YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Stitch Studio β Image to Embroidery Pattern Designer
A professional desktop application for converting images into embroidery machine files (.DST, .PES, .JEF, and more). Built with PySide6 for a modern UI, vector stitch rendering, and complete control over every aspect of the digitizing process.
Features
Thread Library System
- Thread Pack Database β organize your physical thread inventory into packs (by brand, type, project)
- Thread Types β matte, shiny, metallic, neon, UV, glow-in-dark, variegated, silk, cotton, polyester, rayon, wool
- Import/Export β JSON and CSV support for sharing and backing up thread collections
- CIEDE2000 Color Matching β perceptually accurate color matching when quantizing images to your available threads
- Add/Edit/Remove threads with full metadata: name, brand, catalog number, color, type, weight
Image Processing
- Image Adjustments β brightness, contrast, saturation, sharpness, blur with real-time sliders
- Color Quantization β K-means clustering in CIELAB color space with automatic palette matching to your thread collection
- Auto-Segmentation β connected component analysis with morphological cleanup
- Output Size Control β set physical dimensions (mm) with aspect ratio lock
- Configurable Parameters β number of colors, minimum region size, smoothing kernel size, dithering
Stitch Generation Engine (8 Fill Modes)
- Scanline β classic boustrophedon zigzag fill at any angle
- Contour β concentric inward contour fill following region shape
- Flow-Guided β stitches follow image content using structure tensor orientation fields (RK4 streamline integration)
- Satin β zigzag perpendicular to medial axis, auto-adapts width from distance transform
- Radial β rays emanating from region center
- Spiral β Archimedean spiral from center outward
- Stipple β random meandering fill with nearest-neighbor ordering
- Cross-Stitch β decorative X-pattern grid
Per-Region Stitch Control
- Fill mode selector per region
- Stitch direction β fixed angle, image gradient, contour-following, radial, manual
- Angle β 0Β°-360Β° with slider + spinner
- Stitch length β average, min, max with length randomization slider
- Row spacing β density control with multiplier
- Underlay β automatic underlay with configurable angle offset and density
- Contour rows β border stitches before fill
- Pull compensation β outward expansion to compensate for fabric pull
- Flow field controls β strength and smoothing parameters
Layer System
- Multi-color layers β each color is a separate layer with its own regions
- Layer ordering β move up/down, controls stitch execution order
- Per-layer visibility β toggle layers on/off
- Region management β rename, delete, duplicate
- Tree view β expandable layers showing child regions with stitch counts
Vector Canvas
- GPU-accelerated rendering via Qt's QGraphicsView
- Zoom/Pan β mouse wheel zoom, middle-click/alt-click pan
- Stitch path rendering β colored vector paths for each layer
- Region mask overlay β semi-transparent color regions
- Background image β adjustable opacity
- Context menu β toggle visibility of stitches, stitch points, regions, image
Export
- DST β Tajima (universal, works with virtually all machines)
- PES β Brother
- JEF β Janome
- VP3 β Pfaff
- EXP β Melco
- HUS β Husqvarna
- XXX β Singer
- SVG β vector preview
- PNG β raster preview
- Per-layer export support
- Pattern statistics: stitch count, thread length, dimensions, color changes
Project Management
- Save/Load
.sspproject files (JSON with embedded image) - Full state preservation β all layers, regions, settings, source image
- Unsaved changes detection with save prompt
Installation
Requirements
- Python 3.10+
- Windows, macOS, or Linux
Quick Install
# Install dependencies
pip install -r requirements.txt
# Run
python run_stitch_studio.py
# or
python -m stitch_studio
Install as Package
pip install -e .
stitch-studio # run from anywhere
Quick Start
- Launch the app:
python run_stitch_studio.py - Set up threads: In the Thread Library panel (left), add your thread packs via "Add Thread" or import from CSV/JSON
- Load an image:
Ctrl+Ior File β Load Image - Adjust image: Use the Image & Quantization panel sliders
- Set output size: Enter physical dimensions in mm
- Quantize: Click "Quantize & Segment" β maps image colors to your thread palette and segments into regions
- Fine-tune: Select layers/regions in the Layers panel and adjust stitch settings in the Properties panel
- Compute flow field (optional): Process β Compute Flow Field β enables flow-guided fill mode
- Generate stitches:
Ctrl+G - Preview: Zoom/pan on the canvas to inspect stitch paths
- Export:
Ctrl+Eβ choose your machine's format (DST, PES, JEF, etc.)
Thread Pack CSV Format
name,brand,catalog_number,r,g,b,thread_type,weight,quantity,notes
"Bright Red","Madeira","1147",220,30,30,"polyester","40",3,"My favorite red"
"Gold Metallic","Madeira","4002",212,175,55,"metallic","40",1,""
Thread types: matte, shiny, metallic, neon, uv, glow_in_dark, variegated, silk, cotton, polyester, rayon, wool, other
Keyboard Shortcuts
| Key | Action |
|---|---|
Ctrl+I |
Load Image |
Ctrl+Q |
Quantize & Segment |
Ctrl+G |
Generate Stitches |
Ctrl+E |
Export Pattern |
Ctrl+S |
Save Project |
Ctrl+Shift+S |
Save As |
Ctrl+O |
Open Project |
Ctrl+N |
New Project |
F |
Fit canvas to content |
+ / - |
Zoom in/out |
0 |
Reset zoom |
| Middle mouse / Alt+Left | Pan canvas |
| Scroll wheel | Zoom |
| Right click | Context menu |
Architecture
stitch_studio/
βββ __init__.py
βββ __main__.py # Entry point + dark theme
βββ core/
β βββ thread_db.py # Thread database (packs, colors, CIEDE2000 matching)
β βββ project.py # Project model (layers, regions, settings, save/load)
β βββ image_engine.py # Image processing, quantization, segmentation, flow fields
β βββ stitch_engine.py # 8 fill mode stitch generators with flow control
β βββ export_engine.py # pyembroidery export to DST/PES/JEF/VP3/etc.
βββ ui/
β βββ canvas.py # QGraphicsView vector canvas
β βββ panels.py # Thread, Layer, Properties, Image, Stats panels
β βββ main_window.py # Main window with docks, menus, toolbar
βββ data/ # User data directory
Key Technologies
- PySide6 (Qt6) β professional desktop UI with dockable panels
- pyembroidery β reads/writes 45+ embroidery machine formats
- scikit-learn β K-means color quantization
- scikit-image β CIELAB color space, CIEDE2000 distance, morphology
- OpenCV β connected component segmentation, structure tensor
- SciPy β flow field smoothing, interpolation
- Shapely β polygon operations for scanline fill
- NumPy β array processing, flow field computation
Embroidery Tips
Recommended Workflow
- Start with fewer colors (8-12) and increase if needed
- Use flow-guided fill for organic shapes (skin, fabric, nature)
- Use scanline fill for geometric areas
- Use contour fill for borders and text
- Always enable underlay for proper fabric stabilization
- Set pull compensation to 0.1-0.2mm for stretchy fabrics
- Export as PES (Brother) or JEF (Janome) to preserve color data; DST is universal but has no color info
Thread Order
- Embroider light colors first, dark colors last (prevents show-through)
- The layer order in the panel = stitch execution order
- Background/largest areas first, detail layers last
License
MIT β use freely for personal and commercial projects.
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support