Inspiration
I enjoy trying to create the most efficient algorithms for different problems. Maximizing computational power and output is really fun, and working with 10's of thousands of pixels is an easy way to practice.
What it does
This app takes one whole photo and creates a separate photo that looks similar out of a chosen library or average color over a region. The algorithm is a simple RGB distance calculator that compares each pictures average bit map RGB value with another, and returns the best one to display. It uses multithreading to maximize the processing speed of the program by separating each cell into its own thread, and allowing it to work while it continues to operate.
How I built it
I built the GUI using JAVAFX and programmed the backend using regular old java. All of the code in this project belongs to me except for the RGB distance formula that was provided by the wonderful stack overflow.
Challenges I ran into
Multithreading can be challenging, especially when I have never used it before. Populating so many images on a screen using multithreading is harder than I thought. For reasons I am still unaware of the screen would not display certain cells after the thread had completed. I had to instead use a simple O(n^2) for loop to solve the problem. Also comparing RGB values efficiently is very hard to do. At one point I did not think that I would ever get a real image from images because the algorithm was failing.
Accomplishments that I'm proud of
I learned everything I planned on practicing before I came to HackISU. My program works and the code behind it isn't too shabby. I made sure that in the future I can continue to build this software, because I believe that I can really use it as a tool.
What I learned
Pixels are amazing. We take for granted the beauty of these screens that we stare at and don't understand the complex structure that is taking place. I would say I gained a ton of insight on color theory and how pixels render on a screen. Also I learned the value of separating tasks through multithreading and how to stay awake for over 24 hours.
What's next for Twohy's Photo Mosaic Creator
Add the ability to create a gif mosaic.
Log in or sign up for Devpost to join the conversation.