Introduction
The Vectorizer project is an attempt at converting raster images into vector images, using iterative improvement. I was inspired to build this project by similar projects such as those by Roger Alsing and ScreamingDuck, and by discussion on this reddit thread. Some similar projects use a genetic algorithm, which includes a population of solutions and operations such as recombination. I refrain from genetic techniques and instead use a simple hillclimber algorithm. Each iteration finds a better solution than the last, and only the best solution is kept track of.
Hillclimbers are commonly plagued by local optima. To improve the best solution, it applies a mutation function to it, that generates a sequence of different but similar solutions. When none of the new solutions is better than the original, the algorithm halts. I attempt to prevent local optima by choosing a mutation function that can reach the entire solution space, or otherwise a large part of it. The challenge is to get the ordering of the outputs right, so outputs similar to the input are likely to come early.
The reason that I avoid any genetic algorithms is simply that I see no use for them. Contrary to those seen in game problems, the fitness function requires only a single solution as input.
You can find source code for the Vectorizer project here:
https://remy-personal.googlecode.com/svn/trunk/Vectorizer
The project uses a common code project of mine that you can find here:
https://remy-personal.googlecode.com/svn/trunk/CSharpCommonLibrary
The executable can be downloaded below.
Hillclimbers are commonly plagued by local optima. To improve the best solution, it applies a mutation function to it, that generates a sequence of different but similar solutions. When none of the new solutions is better than the original, the algorithm halts. I attempt to prevent local optima by choosing a mutation function that can reach the entire solution space, or otherwise a large part of it. The challenge is to get the ordering of the outputs right, so outputs similar to the input are likely to come early.
The reason that I avoid any genetic algorithms is simply that I see no use for them. Contrary to those seen in game problems, the fitness function requires only a single solution as input.
You can find source code for the Vectorizer project here:
https://remy-personal.googlecode.com/svn/trunk/Vectorizer
The project uses a common code project of mine that you can find here:
https://remy-personal.googlecode.com/svn/trunk/CSharpCommonLibrary
The executable can be downloaded below.
release.zip | |
File Size: | 89 kb |
File Type: | zip |
Examples
Here are some examples of Vectorizer's results