Diastasis separates complex SVG artwork into production-ready layers.
- Two modes:
Overlaid Complexity: overlap-aware layering.Flat Complexity: strict area-exclusive separation.
- Quality presets:
Accurate,Balanced,Fast.
- Complexity estimator:
- shape count, candidate pairs, graph density, ETA.
- Batch mode:
- process all
.svgfiles in a folder with current settings.
- process all
- Export profiles:
Illustrator-safe,Print,Web.
- Visible-boundary clipping (
Clip Shapes To Visible Boundaries). - Performance mode for weaker systems / huge files.
- Flat controls:
- touch policy (
No edge/corner touching,Allow corner touching) - overlap priority (
Source order,Largest first,Smallest first)
- touch policy (
- Layer analytics in summary:
- overlap/conflict count
- tiny fragment count
- per-layer area share
git clone https://github.com/tsevis/Diastasis.git
cd Diastasis
pip install -r requirements.txtpython gui.pyor:
./run_gui.sh- Click
Select SVG. - Choose
Quality PresetandExport Profile. - Click
Estimate Complexity(recommended for heavy files). - Choose mode (
Overlaid ComplexityorFlat Complexity). - Set optional controls:
Clip Shapes To Visible BoundariesPerformance Mode
- Click
Process. - Export with:
Save Layers As...Save Clipped 1-Layer As...
- Configure settings as desired (mode, preset, profile, clipping, etc.).
- Click
Batch Process Folder. - Choose input folder (SVG files).
- Choose output folder.
Each file is processed with the same active settings.
Illustrator-safe: balanced precision, crop marks included.Print: higher path precision, crop marks included.Web: lower precision, no crop marks.
from main import run_diastasis, save_layers_to_files
shapes, coloring, summary, w, h = run_diastasis(
"input.svg",
mode="flat",
flat_algorithm="DSATUR",
flat_touch_policy="any_touch",
flat_priority_order="source",
clip_visible_boundaries=True,
performance_mode=False,
)
save_layers_to_files(
shapes,
coloring,
"output",
"job",
w,
h,
preserve_original_colors=True,
export_profile="Illustrator-safe",
)MIT