Skip to content
Back to skills

Raster To Svg Verified

ASecurity

Convert raster line drawings and diagrams into path-based SVG, optionally recover separately editable closed regions, and verify a rendered PNG against the source. Use for faithful tracing and fill removal on white-background line art, rather than generating a new illustration.

  • 509 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 7, 2026
ai-agentspythongobashapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned November 7, 2026

npx -y skills add aiskillstore/marketplace --skill raster-to-svg-verified --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Raster To Svg Verified?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Raster To Svg Verified
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aiskillstore-raster-to-svg-verified/badge)](https://www.skillsdirectory.com/skills/aiskillstore-raster-to-svg-verified)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: raster-to-svg-verified
description: Convert raster line drawings and diagrams into path-based SVG, optionally recover separately editable closed regions, and verify a rendered PNG against the source. Use for faithful tracing and fill removal on white-background line art, rather than generating a new illustration.
license: MIT
---

# Verified raster to SVG

Trace the supplied pixels in their original coordinate system. Keep visible ink
separate from optional editable regions, then verify structure and appearance
as different properties. Read [the method reference](references/method.md) for
signal selection, region recovery, or interpreting comparison scores.

## Choose the scope

Use this workflow for dark line art on a white or bright background. Inspect
the source before choosing a signal:

- Use the default `luminance` signal to preserve grayscale drawing detail.
- Use `channel-max` only when the user wants bright flat fills removed while
  preserving black or neutral gray ink. It can erase colored strokes and does
  not reliably remove dark fills. See the reference before selecting it.
- For photographs, faithful full-color conversion, or alpha-faithful assets,
  choose another workflow. This helper composites input transparency on white.

The user may want a visually faithful drawing, independently editable regions,
or both. A traced ink silhouette does not by itself recover semantic objects.
Do not add interaction, animation, delivery integrations, or subject-specific
geometry unless the user requests them separately.

## Trace and render

Use an existing suitable environment, or create a task-local virtual
environment. The helper needs Python 3.10+, Potrace on `PATH`, and the packages
in `requirements.txt`. It does not install software or use a hosted API.

```bash
python scripts/vectorize.py drawing.png --out output
```

For explicitly requested bright-fill removal:

```bash
python scripts/vectorize.py drawing.png --out output --signal channel-max
```

The command produces SVG paths, a PNG render, the normalized comparison target,
an ink overlay, a difference image, and a JSON report. It preserves canvas
dimensions and never embeds the source bitmap. Existing output files require
`--overwrite`; the input remains unchanged.

## Recover editable regions when needed

Supply a region specification only when individual closed areas are part of
the requested result. Inspect the raster at 1:1, choose seeds inside its visible
areas, and use the [synthetic example](examples/regions.json) as the schema.

```bash
python scripts/vectorize.py drawing.png --out output --regions regions.json
```

Use source-pixel coordinates throughout. The specification records seed points,
optional local barrier repairs, clipping polygons, excluded areas, and merging
settings. Barriers affect region extraction only; they do not rewrite source
pixels or the visible ink layer. A seed that reaches the canvas boundary is
rejected unless an explicit clipping polygon bounds the reconstruction.

Review each recovered area. Preserve meaningful holes, check neighboring
regions for overlap, and assign stable IDs from observed objects or neutral
region names. Never reuse connected-component numbers across a changed mask.
Disclose repaired or inferred borders; closed geometry does not prove identity.

## Verify the result

Read the report and inspect the source, rendered PNG, and overlay at the same
scale. For editable regions, review their boundaries independently of the ink.

- Check valid SVG, the expected `viewBox`, unique IDs, and real paths.
- Check that there are no embedded images, executable content, external asset
  references, or live text requiring a matching font.
- Check every editable region has explicitly closed subpaths and a distinct ID.
- Compare ink F1, foreground RMSE, and boundary distance, together with the
  images. Whole-image RMSE can conceal errors in a mostly blank canvas.

Fix the discrepancy indicated by the comparison, re-render, and compare again.
Change trace parameters for visible-ink errors; change the region specification
for boundary leaks or incorrect region membership. Preserve intermediate output
when the user asks to review it. Do not interpret a visual score as proof of
semantic correctness, and do not claim pixel-perfect equivalence.

Deliver the requested SVG and preview with a concise statement of what was
checked and any reconstructed borders. Publication and messaging require the
user's authorization; this skill does not provide it.

Files in this skill

  • .github/workflows/verify.yml701 B
  • .gitignore54 B
  • LICENSE1 KB
  • README.md3.1 KB
  • SKILL.md4.4 KB
  • agents/openai.yaml252 B
  • examples/difference.png4.9 KB
  • examples/drawing.svg9.9 KB
  • examples/overlay.png2 KB
  • examples/reference.png4.4 KB
  • examples/regions.json534 B
  • examples/render.png7.7 KB
  • examples/report.json1.4 KB
  • examples/source.png9 KB
  • references/method.md7.9 KB
  • requirements.txt80 B
  • scripts/make_example.py2.5 KB
  • scripts/vectorize.py15.3 KB
  • skill-report.json31.2 KB
  • tests/test_pipeline.py6.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.