png2svg(1)

πŸ’– png2svg β€” the glow-up your tiny PNGs deserve πŸ’–

okay bestie, so this is a User Commands page from section 1 of the manual, and it's about png2svg(1) β€” the little tool that takes your cute pixel art and turns it into fancy scalable vector art. i got you, sit down, grab a strawberry πŸ“


✨ NAME ✨

png2svg β€” converts PNG images into SVG Tiny 1.2. no cap, that's the whole job description πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

png2svg [OPTIONS] input.png

one input, a pile of options, she does the thing. periodt.


🌸 DESCRIPTION 🌸

so here's the tea: png2svg takes small PNG images and converts them into SVG Tiny 1.2. how? by drawing a rectangle for every region that can be covered by a single rectangle β€” like, she's out here doing the least amount of work possible, which is honestly iconic behavior πŸ‘‘

the pixels that can't get grouped into a nice big rectangle? those get their own rectangle, one per pixel. no pixel left behind, fr fr.

transparent PNGs are handled, because she's not rude: the transparent regions just don't get any SVG elements drawn for them at all. nothing to see there, literally πŸ’€

and the resulting SVG images? you can open them straight up in a browser and they stay crisp when you scale them up, which is lowkey the entire reason you'd do this β€” it's giving pixel art and icons, major main character energy ✨


πŸŽ€ OPTIONS πŸŽ€

  • -o FILENAME β€” names the SVG output file. use - and it goes to stdout instead, which is also the default πŸ’–
  • -n N β€” shrinks the palette down to N colors before the conversion even starts. vibe check your color count first 🎨
  • -l β€” caps colors at a maximum of 4096, the way that it shortens the strings too: #abcdef β†’ #ace. shorter, cuter, valid 🌈
  • -p β€” only single pixel rectangles. one rectangle per pixel, no grouping, no shortcuts, just raw pixel-by-pixel honesty 😭
  • -c β€” colors the expanded rectangles pink so you can see what's going on. it's for debugging, but ngl it's also just a slay aesthetic 🌸
  • -q β€” deprecated. same as -l. she's retired, don't @ her πŸ™ˆ
  • -z β€” deprecated. also same as -l. also retired. throwbacks only 🫢
  • -v β€” verbose output, so she tells you her progress like a good bestie keeping you updated πŸ’¬
  • -V or --version β€” prints the version and exits. immediate, efficient, obsessed πŸ‘‘

⭐ EXAMPLES ⭐

okay so these are the actual glow-up recipes, copy them exactly:

generate an SVG image with as few rectangles as possible:

png2svg -o output.svg input.png

generate an SVG image with one rectangle per pixel:

png2svg -p -o output.svg input.png

limit to 4096 unique colors, with verbose output:

png2svg -v -l -o output.svg input.png

reduce to 32 colors and limit color strings:

png2svg -v -l -n 32 -o output.svg input.png

πŸ’œ NOTES πŸ’œ

real talk time. the conversion is fast for small images β€” adorable, instant, chef's kiss. but for larger images it will take an unreasonable amount of time to convert, and it'll spit out SVG files that are many megabytes in size. so like. know what you're getting into, bestie, this is not the tool for your 4K screenshots πŸ’€

the resulting SVG files can be further optimized with tools like svgo though, so you can always hand it off for a second round of self-care ✨


πŸ”₯ SEE ALSO πŸ”₯

go read that one next, iykyk 🧚


πŸ’… VERSION πŸ’…

1.7.1


πŸ‘‘ LICENSE πŸ‘‘

BSD-3


🌈 AUTHOR 🌈

png2svg was written by Alexander F. RΓΈdseth <xyproto@archlinux.org> β€” thank you for your service, king 🫢


and that's the whole page, bestie!! this manual page is from 28 May 2026, source png2svg, so if you see that date, that's the vibe. run her, love her, scale her up forever πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from