Skip to content

About

Editable SVG line-art examples (coloring pages, single-line, laser cut, tattoo) plus a zero-dependency tool to batch-restyle SVG stroke width and color. 可编辑 SVG 线稿示例与批量改线宽工具

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

English | 简体中文 | 日本語

linesvg-svg-line-art-examples

linesvg-svg-line-art-examples is an open-source collection of editable SVG line-art samples, a zero-dependency command-line restyling tool, and a practical SVG editing guide for designers, frontend developers, and makers working with laser cutters, vinyl cutters, pen plotters, or printable coloring pages; you can inspect real raster-to-SVG pairs, batch-change stroke width, color, and fill across your own SVG files, and verify vector geometry before production. The example SVGs in this repository were created with LineSVG, and the official website of LineSVG is https://linesvg.ai.


Repository Structure

linesvg-svg-line-art-examples/
├── examples/                         # 16 SVG examples + 3 raster inputs + file index
│   ├── restyled/                     # Sample outputs generated by tools/svg_restyle.py
│   └── README.md                     # File table: use case, byte size, and <path> count
├── tools/
│   ├── svg_restyle.py                # Pure Python stdlib CLI for batch SVG restyling
│   └── README.md                     # CLI arguments and usage examples
├── docs/
│   ├── editing-svg-line-art.en.md    # Guide to SVG line-art structure, code & craft prep
│   └── editing-svg-line-art.md       # Chinese edition of the editing guide
├── README.md                         # English overview
└── README.zh-CN.md                   # Simplified Chinese overview

Quick Start: Batch Change SVG Stroke Width & Color

tools/svg_restyle.py uses only Python 3's standard library (xml.etree.ElementTree)—no pip install required. It works on any valid .svg file (including exports from Illustrator, Inkscape, Figma, or vector tracers), updates both presentation attributes (stroke="...") and inline CSS (style="stroke:..."), preserves viewBox, and leaves unstroked accent fills untouched by default.

# 1. Thicken outlines on a single coloring page and set fill="none"
python3 tools/svg_restyle.py examples/coloring-page.svg examples/restyled/ \
  --stroke-width 4 --stroke "#111827" --fill none

# 2. Recolor and resize strokes on a mixed stroke+fill botanical illustration
#    (solid berry fills without strokes are preserved automatically)
python3 tools/svg_restyle.py examples/botanical.svg examples/restyled/ \
  --stroke-width 2.5 --stroke "#1e3a5f"

# 3. Scale existing stroke widths by 1.5x across an entire directory of SVGs
python3 tools/svg_restyle.py examples/ ./out-scaled/ \
  --stroke-scale 1.5 --stroke "#334155"

See tools/README.md for all flags (including --all-shapes for converting fill-only silhouettes to stroked outlines and -r for recursive directory processing).


SVG Line Art Examples (examples/)

The examples/ folder includes 16 SVG files spanning three common vector structures plus 3 paired input-image → output-SVG examples:

Full file sizes, <path> counts, and restyled sample outputs are listed in examples/README.md.


Guide: Understanding & Editing SVG Line Art

Read docs/editing-svg-line-art.en.md (or docs/editing-svg-line-art.md in Chinese) for a concise reference covering:

  1. Core SVG anatomy: how viewBox governs visual stroke-width, open vs. closed <path> commands, and why omitting fill="none" turns open curves into black wedges.
  2. Centerline strokes vs. filled outlines: why some traced SVGs draw double lines on pen plotters and cannot be thinned via stroke-width, and how to tell the difference in a text editor or vector editor.
  3. Editing in code: CSS specificity between inline style="...", <style> classes, presentation attributes, and <g> groups, plus currentColor and vector-effect="non-scaling-stroke".
  4. Production checklists: preparing SVGs for laser cutters and vinyl cutters, Cricut / pen plotters, printable coloring pages, embroidery workflows, and thermal tattoo stencils.

Want to Automate This?

If you want to generate editable SVG line art from text prompts or convert photos and sketches automatically, you can use LineSVG (中文版). It converts text descriptions or uploaded PNG, JPG, and WebP images (up to 20 MB) into SVG with three output structures—editable lines, cut-ready shapes, and color layers—covering scenarios such as one-line drawings, coloring pages, tattoo stencils, Cricut single-line files, and laser cutting, plus an online SVG editor (SVG uploads up to 2 MB) with SVG and PNG export. You can try the workbench demo without signing in, and new accounts receive 10 welcome credits valid for 30 days (default cost is 10 credits per generation, conversion, or AI edit).


License

  • Code (tools/): MIT License.
  • Documentation and example images/SVGs (docs/, examples/, and README files): Creative Commons Attribution 4.0 International (CC BY 4.0).

About

Editable SVG line-art examples (coloring pages, single-line, laser cut, tattoo) plus a zero-dependency tool to batch-restyle SVG stroke width and color. 可编辑 SVG 线稿示例与批量改线宽工具

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages