Vexy Lines for Mac & Windows | Download | Buy | Batch GUI | CLI/MCP | API | .lines format
vexy-lines-py¶
Parse Vexy Lines .lines vector art files in pure Python.
What it does¶
A .lines file holds everything Vexy Lines needs to reproduce a piece of vector artwork: the layer tree (groups, layers, fills with algorithm parameters), document properties, and optionally the original source image and a rendered preview, all packed into XML.
This package reads that XML and gives you typed Python dataclasses. It can also replace the embedded source image to reuse a fill style with different content.
Quick start¶
from vexy_lines import parse, GroupInfo, LayerInfo
doc = parse("artwork.lines")
print(doc.caption, doc.dpi) # "My Art" 300
print(doc.props.width_mm, "x", doc.props.height_mm, "mm")
# Walk the layer tree
for node in doc.groups:
if isinstance(node, GroupInfo):
for child in node.children:
if isinstance(child, LayerInfo):
for fill in child.fills:
p = fill.params
print(p.fill_type, p.color, f"interval={p.interval}")
Extract embedded images¶
Every .lines file can contain a JPEG source image (the original photo) and a PNG preview (the rendered result). You can pull them out without opening the app:
from vexy_lines import extract_source_image, extract_preview_image
extract_source_image("artwork.lines", "source.jpg")
extract_preview_image("artwork.lines", "preview.png")
Replace the source image¶
Swap the source photo in an existing .lines file to reuse its fill style with new content:
from vexy_lines import replace_source_image
replace_source_image("template.lines", "new_photo.jpg", "output.lines")
Rename objects and toggle visibility¶
Edit a .lines file by object_id (from GroupInfo/LayerInfo/FillNode) while preserving everything else byte-for-byte. Both write to output_path (use the same path to edit in place) and return the count changed:
from vexy_lines import rename_objects, set_visibility
# Rewrite captions of groups, layers, and/or fills.
rename_objects("artwork.lines", "artwork.lines", {1: "Background", 10: "Sky lines"})
# Bake per-object visibility into a copy: only fill 10 stays visible.
set_visibility("artwork.lines", "fill_10_only.lines", {10: True, 11: False, 12: False})
set_visibility writes the visible="0"/"1" attribute (absent = visible). Toggling it live over the app's MCP API does not change what the app exports, but re-opening a baked copy does. This is how the AI-rename feature renders one fill in isolation.
Parse from a string¶
When you already have the XML in memory:
from vexy_lines import parse_string
doc = parse_string(xml_content)
Why this package exists¶
Vexy Lines is a macOS/Windows app that transforms raster images into vector artwork using 14 fill algorithms. The .lines file format stores everything, but the XML is undocumented.
This package decodes that format so you can:
- Inspect artwork metadata without the app
- Extract embedded images for thumbnailing or cataloguing
- Feed fill parameters into automation pipelines
- Replace source images to reuse fill styles with different content
- Rename objects by ID and bake per-object visibility into a copy (powers the AI-rename feature)
- Build tools on top of the parsed data (style transfer, interpolation, batch processing)
Next steps¶
- Installation: install options and requirements
- API Reference: every class, function, and constant
- File Format: how
.linesXML is structured - Examples: real-world usage patterns
