Matthew Peterson's profile

ASCII Generator - Hackathon Project

ASCII Generator - Hackathon Project
This was my second "Hackathon", in which I had 4 hours to create anything I wanted from scratch. I really enjoy programming, so I chose another programming project. I had seen pictures made completely out of keyboard characters before, and thought it would be a fun challenge to try to make something that takes a picture and turns it into characters. I later learned that what I was trying to make was called an "ASCII Generator", because the characters it is made out of are called ASCII characters.​​​​​​​
To help ease some of the burden that came with learning a completely new side of programming, I found a library to help with image processing. With it came examples, so I was able to use those to learn how it worked and then apply that to my project. 

Even still, just like in my first Hackathon, the brunt of the time was spent getting the basics of the project working. It took me an hour and a half just to get this image below.
After that, I was able to implement new things in much better time. I first focused on mapping a value to a specific ASCII character, as well as mapping the mouse position to the shade of the character (this was just a proof of concept)
Then I worked on displaying characters in a grid, which you can see did not go well at first
It was a quick fix though
And from here, it was just a matter of combining the things I had developed already with a helpful function from the library that could get the tone of each pixel
At this point, I had the basic functionality I was looking for and had time to spare, so I added some additional features. First was the ability to change the level of detail by moving the mouse​​​​​​​
Finally, I added the ability to give the picture color by pressing the spacebar. This also used that helpful tone function from the library
These additions were great for adding some 'flair' to my presentation, and I ended up winning the popular vote for people's favorite project.

This project was daunting at first because I had never worked with images before. However, thanks to some research, helpful references and libraries, and some brute force coding, it ended up being a really fun project and something that I'm proud to show off.
ASCII Generator - Hackathon Project
Published:

ASCII Generator - Hackathon Project

Published: