This page last changed on Oct 09, 2006 by scytacki.

Original Image

Inkscape Trace

Multiple scanning color, 7 scans, smooth off, stack on

Here is the result with the 7 scans

The top image is the combined trace. It looks pretty good, but notice the eye and teeth color is wrong. You should also notice there is a lot of redundant paths.

Here is a zoom in on the eye

Original eye Traced Eyed

The antialiasing is what causes the wrong colors and part of the redundant path information.

The wrong colors are because the number of pixels in the antialiasing is higher than those in the eyes and the teeth. So when the colors in the image are quantized to 7, the antialiasing colors are used instead of the eye and teeth color.

Removing Antialiasing

This page has a technique for removing antialiasing from images like this.

Removing Antialiasing

Quantizing

Now that the antialiasing pixels have been removed. The image can be traced with inkscape, but it might still have a problem. Sometimes these images have "noise" in the solid color areas. So that what looks like solid green is actually a few different shades of green. When Inkscape does its color tracing it will do a quantizing pass over the image to reduce it to X colors. This quantize pass is very basic, so if there are two shades in a large color area, it will use two of the X colors for that. One solution to this is to specify the actual palette.

Here is a noisy version version of the fish after the antialiasing has been removed:

Doing a color quantizing the similar to how inkscape does it using this command

pnmquant 8 fish-demo-noise_0.1-aliased.ppm > fish-demo-noise_0.1-aliased-quant.ppm

Gives this result

Doing a color quantizing with the actual palette gives a much better result

pnmremap -mapfile=palette.ppm fish-demo-noise_0.1-aliased.ppm > fish-demo-noise_0.1-aliased-quant_palette.ppm

Tracing Layers

The next step is to deal with the redudant information. If you look at the result of the inkscape trace above, there are several duplicate shapes in each of the color paths. This is because of the way Inkscape combines the colors to make layers. The below page addresses that issue.

Tracing Color Layers

Example scripts for doing all these steps over a sequence of images.

Color Tracing Scripts


Document generated by Confluence on Jan 27, 2014 16:56