I was thinking about the Octocat challenge, and thought about interesting ways to draw Octocat when I decided that having a program "draw" arbitrary images seemed like an interesting idea.

What it does

It takes an image, does an edge detection algorithm, and divides it up into several "lines." Then, it slowly reveals each of the lines, giving the impression that it was drawing. You can press space after it loads to unload it, and then space again to load it again.

How I built it

I used SDL, SDL_image for dealing with .pngs, and OpenGL. I used C++ for coding this, and modified an old makefile from a Computer Graphics class.

Challenges I ran into

The main challenge was trying to figure out how to actually group everything up into lines and how to make it convincing that those lines were being "drawn." More specifically, the way I was drawing lines, there were times where there were 600+ lines that were shorter than between 1 and 30 pixels for a simple drawing, so adding those pixels to established lines was the hardest part of it.

Accomplishments that I'm proud of

I'm glad that I just got it working! Despite the fact that a small image takes a few minutes to load, it looks cool, and was something that I honestly stared at for half an hour if not more when I was done.

What I learned

I refreshed my knowledge on edge detection algorithms and scaling of images. I also learned how pixel data works in SDL.

What's next for Self Drawing Program (Local Hack Day 2019)

Maybe making it load faster? Maybe doing some sort of cel shading to this as well or something? Fixing the README so I have actual instructions for Windows builds (and cleaning up the Linux build instruction)

Video Demo (Google Drive Video)

OS X Binary (Might Not Work)

Built With

Share this project: