This program is made using artifical neural networks, and basic perceptrons algorithm with pocket.
There are some examples of pictures which you can use to feed altorithm, but you can also prepare yours. As first push "Learn" button and then select picture on the left side and add some noises. After check (it can tak a while) for better encode push recursion button and generated on the right side picture should be better.
Posibilities to improve performance is to get all grid elements to map and which allow to take them form DOM only once. It should improve time of checking results.
In the picture below you can see how picture of tree with noises encoded.