This is some code I wrote 6 years ago and never released, just after I saw this insipring blog post of 2008. I remember my son having tons of fun with this, so while I rarely touched the code at all, I ran it multiple times for him, and I plan to do it again when my daughter is old enough to understand it.
Note that the program was written entirely as a trow-away, so the internal structure is not as good as it should be. However I performed some minimal refactoring after the release just to remove blatantly duplicated code, but still, far from good code.
So what it does?
Since it uses the SDL library, it shows visually the evolution of the image, and I believe this is what was so cool for my son to watch, and probably you'll have fun too.
In the release there is an example PNG you can use, the Annunziata, a painting authored by Antonello da Messina, a Sicilian painter.
This is what the program outputs with 64 triangles after a few minutes of evolution: http://antirez.com/misc/monnalisa.png

There is a terrible Makefile. Try make... It needs:
Basic usage using the example image:
./shapeme annunziata.png /tmp/annunziata.bin /tmp/annunziata.svg
For additional options just run the program without args, it will print some help.
Have fun!
15 commits
C
99.3%
This is some code I wrote 6 years ago and never released, just after I saw this insipring blog post of 2008. I remember my son having tons of fun with this, so while I rarely touched the code at all, I ran it multiple times for him, and I plan to do it again when my daughter is old enough to understand it.
Note that the program was written entirely as a trow-away, so the internal structure is not as good as it should be. However I performed some minimal refactoring after the release just to remove blatantly duplicated code, but still, far from good code.
So what it does?
Since it uses the SDL library, it shows visually the evolution of the image, and I believe this is what was so cool for my son to watch, and probably you'll have fun too.
In the release there is an example PNG you can use, the Annunziata, a painting authored by Antonello da Messina, a Sicilian painter.
This is what the program outputs with 64 triangles after a few minutes of evolution: http://antirez.com/misc/monnalisa.png

There is a terrible Makefile. Try make... It needs:
Basic usage using the example image:
./shapeme annunziata.png /tmp/annunziata.bin /tmp/annunziata.svg
For additional options just run the program without args, it will print some help.
Have fun!
15 commits
C
99.3%