All examples By author By category About

fabiovalse

Ricci Vectorized Map

This gist shows the vectorized version of the first three panels of the "Kunyu Wanguo Quantu".

Use imagemagick for converting the jpg file into a bitmap.

convert ../Kunyu_Wanguo_Quantu_by_Matteo_Ricci_Plate_1-3.jpg ../Kunyu_Wanguo_Quantu_by_Matteo_Ricci_Plate_1-3.bmp

The potrace tool is then used to vectorize the bitmap.

./potrace -k 0.2 --svg ../Kunyu_Wanguo_Quantu_by_Matteo_Ricci_Plate_1-3.bmp -o ../Kunyu_Wanguo_Quantu_by_Matteo_Ricci_Plate_1-3.svg

Look at

-t n, --turdsize n suppress speckles of up to this many pixels.

-k n, --blacklevel n set the threshold level for converting input images to bitmaps. The potrace algorithm expects a bitmap, thus all pixels of the input images are converted to black or white before processing begins. Pixels whose brightness is less than n are converted to black, all other pixels to white. Here n is a number between 0 and 1. One case is treated specially: if the input is in an indexed color format with exactly 2 colors, then the blacklevel is ignored and the darker of the two colors is mapped to black.