2020-06-18 13:08:22 -05:00
|
|
|
How to trace a bitmap to svg in multiple colors:
|
|
|
|
|
2020-07-30 08:23:11 -05:00
|
|
|
|
|
|
|
Dependencies: imagemagick, netpbm, potrace
|
|
|
|
|
2020-06-18 13:08:22 -05:00
|
|
|
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:
|
2020-06-19 02:53:56 -05:00
|
|
|
|
|
|
|
|
|
|
|
Articles:
|
|
|
|
|
|
|
|
- http://confluence.concord.org/display/CCTR/Removing%20Antialiasing.html
|
|
|
|
- http://confluence.concord.org/display/CCTR/Tracing%20Color%20Raster%20Images.html
|