Hello,
I have an image with relatively few colors (32) but only about eight of them are really used. It's a comic-style drawing, so there are many, large color areas. The rest of the colors is used to antialias between these 8 colors.
When I try to trace this image with multi-scan/color, I get paths with a large number of nodes (roughly 6000 per color).
These cannot be reduced because the colors immediately start to leak.
One of the problems is a red blob at the bottom of the image. Without stacking, the result is not very good. With stacking, I get an insane red path behind all the rest of the image!
Therefore, I'd like to discuss these optimizations:
1. First find out which color is used how often. Then for tracing, sort the colors from least to most used. This way, seldom used colors will only need small paths.
Even better, if colors don't overlap (just do a simple bounding box check), handle them as one layer.
2. First, create one path which contains all the black parts of the image.
Then, while looking for other colors, ignore the black pixels.
Instead, while searching, simply go on as if the black pixel had the same color as the non-black pixel you just came from. Only remember the position of the last non-black pixel.
When you hit the next non-black pixel, compare it with the last one. If they are equal, connect the two (as if there was no black between). If they are not, use the stored position as the border.
Finally, after all colors have been traces, overlay the group with the black trace.
This should give much better results for comics because the black lines cut the other colors into very many small areas.
Maybe the "foreground" color should be configurable to allow to do the same with images which use white lines, etc.
Regards,