Final Project
We. Are. Done. Finally, our program works like a charm, after several days of research and hardwork, our project is capable of resizing an image and changing the color to black and white.
We kinda did it in two parts, the first one being the black and white, that you can check out here.
For the “second part”, we researched and found out how to resize the source image using math and arrays. These links were reaaaaaally useful:
http://stackoverflow.com/questions/27351737/c-how-to-shrink-an-image-using-a-pointer-array http://stackoverflow.com/questions/299267/image-scaling-and-rotating-in-c-c http://doc.gnu-darwin.org/ImageMagick/www/ImageMagickObject.html http://www.cplusplus.com/forum/general/2615/
Basically, what resizing does is to take 4 RGB pixels (2 width, 2 height) get an average of every color (red, green, and blue) like it did on the B&W part, and add this to a new pixel, creating a new resized image which is half the size of the original.
We worked together with Eduardo and we mutually helped each other. And, of course, we did check out some other codes because we couldn’t simply start. So we appreciate Miguel Ángel’s work, as well as the help provided by Eduardo.
Now, we had a lot of errors during the process about syntax but the one we dealt with the most was an error called “segmentation fault”. After battling with it, Eduardo and us found out that our program wasn’t the problem, but the source image was. We looked and tried several images until we found one that worked, which was the golden retriever puppy on the English Wikipedia page of “Puppy”. We then found out other images that didn’t throw us the error as well.
We are really happy about the outcome of the project.
Here are some screenshots:
You can check out our final code here.











