0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-02 04:40:09 -05:00
penpot/tracebitmap.txt
Andrey Antukh 17813e5090 🎉 Add svg export.
2020-08-05 11:19:34 +02:00

771 B

How to trace a bitmap to svg in multiple colors:

Dependencies: imagemagick, netpbm, potrace

Generate the PPM format from PNG:

convert download.png download.ppm

Generate a mask file for each color of the file:

ppmcolormask "#184d47" download.ppm > download-mask1.pbm ppmcolormask "#66462C" download.ppm > download-mask2.pbm

Then trace the bitmap (bitmap -> svg):

potrace --flat -b svg download-mask1.pbm -o download1.svg potrace --flat -b svg download-mask2.pbm -o download2.svg

Extract a list of colors from an image:

convert download.png +dither -colors 10 -unique-colors txt:

Articles: