I have been using Illustrator's Image Trace (LiveTrace on or before CS5) for many years. I would like to replicate a similar result with open-source software. I assumed that Illustrator would first quantize the raster image into the determined colors and then apply edge-detection with a version of Ramer-Douglas-Peucker for vectors. I get different results in Illustrator or Inkscape, with the original image or with a quantized version of the image.
source images
Here is part of the original image showing a mouth:
and here is the quantized version with 5 clusters (following the OpenCV documentation):
results in Illustrator
I used these settings for Image Trace:
The result with the original image is:
The result with the quantized image is:
results in Inkscape
The settings in Inkscape are below. I'm not sure if the settings in the top box affect the bottom one. It has fewer settings than Illustrator.
The result with the original image is:
The result with the quantized image is:
questions
Results are different with the original versus the quantized image, and with Illustrator versus Inkscape. I like Illustrator with the original image better because the continuous line of the mouth gives a certain charm to the image and it also removes noise in the image, such as the patch of a different color above the mouth.
I once found a link describing the Image Trace algorithm in a few papers and now can no longer find it. Thanks to @BilleyKerr's comment, I understand that Image Trace is proprietary and probably a trade secret, so I will never know exactly how it works. My questions are:
- how does Trace Bitmap work?
- how can I get a result similar to Image Trace inside Inkscape, e.g. with threshold and level of blur?
- I have found other command-line tools that vectorize a raster image, such as Potrace, ardeco, and rastertovector, has anyone used those or others with results and tuning settings similar to Image Trace?