Skip to content

feat: rasterize (SVG → PNG) subcommand#48

Merged
realproject7 merged 1 commit into
mainfrom
task/rasterize
Jun 19, 2026
Merged

feat: rasterize (SVG → PNG) subcommand#48
realproject7 merged 1 commit into
mainfrom
task/rasterize

Conversation

@realproject7

Copy link
Copy Markdown
Owner

Adds svgsmith rasterize to render an SVG back to PNG (CairoSVG, already a dep): intrinsic viewBox size by default, --width/--height/--scale/--background to override. Size detection regex-scrapes the root tag (no full XML parse of untrusted input). Tests + README added.

🤖 Generated with Claude Code

Adds 'svgsmith rasterize input.svg [--out --width --height --scale --background]'
— the inverse of the vectorizer, via CairoSVG (already a dep). Defaults to the
SVG's intrinsic viewBox size; --width/--height/--scale override.

The input SVG may be user-supplied, so size detection only regex-scrapes the root
<svg> tag rather than running a full XML parse (avoids the XXE/entity-expansion
surface stdlib ET would add on untrusted input); CairoSVG does the rendering.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@realproject7 realproject7 merged commit c629d42 into main Jun 19, 2026
0 of 2 checks passed
@realproject7 realproject7 deleted the task/rasterize branch June 19, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant