|Easily Convert Bitmap Images To Clean Vector Art|
This tutorial describes how to convert a scanned image into vector art. This process is called tracing or vectorization, and can either be done manually or using an automatic tool. In this tutorial, we explain how to use Vector Magic to perform this conversion quickly and easily.
Scanning hardware and software varies between manufacturers, so I will keep my remarks as general as possible. The following remarks are guidelines only; please experiment with your particular hardware, software, and source material to find the best choices for your particular case. I have found:
In order to illustrate some of the characteristics of scans, I've done a little experiment.
In this section, I will describe my findings. As I indicated in the best practices section above, I concluded that it doesn't really make any sense to scan at higher than 300 dpi. Sure, scanning at 600 dpi, gives you an image of twice the size, but it is also twice as blurry.
Zooming in on an edge in the image is instructive.
|150 dpi||300 dpi||600 dpi|
In the 150 dpi case, the blurring at the edge is essentially just one pixel wide. This is how it should be. If the edge is infinitely sharp, then it should only be seen by one pixel in the scanner's sensor. That pixel should then be some appropriate gray, depending on how far across the pixel the edge actually lay.
In the 300 dpi case, the blurring spans two or three pixels, indicating that some blurring has occurred. It is not clear whether this is due to limitations of the physical sensors or some processing done by the scanner or the scanner software. In either case, the effective resolution of this image is not 300 dpi.
Likewise in the 600 dpi case, where the blurring spans three or four pixels. Again, such a blurry result should be considered to have a much lower effective resolution.
In this case, I think it would make the most sense to scan at 150 dpi. In cases where a better scanner were available, it might make sense to scan at 300 dpi.
I have elected to use the 150 dpi scan. Using Vector Magic Desktop Edition, I vectorize it with the following steps:
By and large, the result is very good. There are a few corners that are slightly rounded in the result but that are sharp in the original, but for the most part the vectorized result matches the original quite well. The SVG output from this vectorization may be downloaded here.
The screen shots below show a zoomed in section of the result. The first image is the vectorized result, the second image is the corresponding section of the bitmap, and the third image is an overlay of the vector paths on top of the bitmap original. In this section, the result appears crisp and clean, and clearly reproduces the original shape very well.
Unfortunately, not all source images are as crisp and clean as the previous example. That example was generated by printing a vector graphic with a laser printer and then immediately scanning it back in. The following example is much more challenging.
This scan is much more typical of scans. The person who scanned it made the mistake of leaving the scanner in color mode, so there are color edge artifacts along the shape boundaries. The original print quality appears to have been poor, and the shape is generally irregular, as though it were hand drawn. A size-reduced version of the image is shown below, and the full resolution version may be found here.
The following zoom view illustrates some of the challenges of this source image.
The discoloration is clearly visible. The tops of the white shapes are tinted blue and the bottoms red. The edges also appear highly irregular.
Again, I use Vector Magic Desktop Edition to vectorize this image. In this case, I try both "Medium" and "Low" quality settings to see how they turn out.
It should be noted that when a large image, such as this one, is loaded into Vector Magic Desktop Edition, the program analyzes the image to determine whether it makes sense to reduce the size of the image. Please note that the resize function that is used is very carefully selected to improve the quality as much as possible through effective use of pixel averaging. Most resizing features in commercial bitmap editors do not perform scaling operations in this way, so please rely on Vector Magic to perform any shrinking operations. And never increase the size of a bitmap before loading it into Vector Magic. Such efforts only ever reduce the quality of the result.
The next three images show highly zoomed-in views of the original scan and the two vectorized results. The first is the original, the second is from the low result, and the third is from the medium result.
Which of the two results is better is a matter of preference. The low result uses fewer nodes and results in a simpler geometry, while the medium reconstructs the geometry more faithfully but uses more nodes. I personally prefer the medium input quality result but I can see the merits of both.
I have included one final image of the paths from the medium result over the top of the bitmap. As usual, you can see that the paths very closely follow the source bitmap. This characteristic is one of the great strengths of Vector Magic relative to other auto-vectorization tools.
This tutorial has provided guidelines and advice for how to best vectorize scans using Vector Magic Desktop Edition. A number of practical tips were provided to help you get the most out of your source material and your scanner. And we showed two example of scans being vectorized: the first was a high quality scan of a crisp good-quality original, and the second was a low-quality scan of a low-quality original.
I strongly encourage you to play around with this. Vector Magic can be a powerful tool for vectorizing scans if used properly.