png2svg(1)

NAME
png2svg - convert PNG images to SVG Tiny 1.2

SYNOPSIS
png2svg [OPTIONS] input.png

DESCRIPTION
Convert small PNG images to SVG Tiny 1.2 by drawing rectangles for each region that can be covered by a single rectangle. The remaining pixels are drawn with a rectangle per pixel.

Handles transparent PNG images by not drawing SVG elements for the transparent regions.

The resulting SVG images can be opened directly in a browser and will look crisp when scaled up, which is useful for pixel art and icons.

OPTIONS

-o FILENAME
    SVG output filename. Use - for stdout (default).

-n N
    Reduce the palette to N colors before conversion.

-l  Limit colors to a maximum of 4096 (#abcdef → #ace).

-p  Use only single pixel rectangles (one rectangle per pixel).

-c  Color expanded rectangles pink (for debugging).

-q  Deprecated (same as -l).

-z  Deprecated (same as -l).

-v  Verbose output, showing progress information.

-V or --version
    Print the version and exit.

EXAMPLES

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
The conversion is fast for small images, but larger images will take an unreasonable amount of time to convert, creating SVG files many megabytes in size.

The resulting SVG files can be further optimized with tools like svgo.

SEE ALSO
svgo(1)

VERSION
1.7.1

LICENSE
BSD-3

AUTHOR
png2svg was written by Alexander F. Rødseth <xyproto@archlinux.org>