Public: Technology Reviews : Tracing Color Raster Images
This page last changed on Oct 09, 2006 by scytacki.
Original ImageInkscape TraceMultiple scanning color, 7 scans, smooth off, stack on Here is the result with the 7 scans Here is a zoom in on the eye
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 AntialiasingThis page has a technique for removing antialiasing from images like this. QuantizingNow 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 LayersThe 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. Example scripts for doing all these steps over a sequence of images.
fish-demo.png (image/png)
fish-demo-inkscape-trace.svg (image/svg+xml) fish-eye-zoom.png (image/png) fish-eye-inkscape-trace.png (image/png) fish-eye-inkscape-trace.png (image/png) fish-eye-inkscape-trace.png (image/png) fish-eye-inkscape-trace.png (image/png) fish-demo-inkscape-trace.png (image/png) fish-demo-edge-gray.png (image/png) fish-demo-aliased.png (image/png) fish-demo-noise_0.1-aliased.png (image/png) fish-demo-noise_0.1-aliased-quant.png (image/png) fish-demo-noise_0.1-aliased-quant_palette.png (image/png) |
Document generated by Confluence on Jan 27, 2014 16:56 |