HERE IT IS!! AFTER A HUNDRED YEARS!!

Finally, my project is finished, of course with some help but, who didn’t need it?

In the code were 2 functions, one for grayscale and the other for scale (1/2);

What the grayscale function did was basically taking the RGB color property (1) for each pixel of the image, and getting the average of that 3 properties (redQuantum, greenQuantum and blueQuantum) to create a new color (2) and then creating a pixel with that color, to then add it to the picture in its correct place.

The scale function basically did the same, but now with 4 pixels. I mean it took the RGB of 4 pixels (2 up and 2 down), got the average of redQuantum, greenQuantum and blueQuantum and give that RGB properties to a new pixel, which takes place in a new picture that is half high and half wide, created by taken the size of the original and dividing it by 2. (3)

Here is our code: Hell yeah here it is

Now, my experience during this project… A lot of trouble, since trying to install magick++ on Mac to then giving up and installing it on Ubuntu… But I was a good friend and told everybody to stop losing their time trying to install it on Mac o Windows, so everybody did it on Ubuntu.

I, as at least half the class, got help from the codes of some partners, in my case, specially Miguel Angel Cardenas so, I thank him, who probably doesn’t know who I am but that’s mutual.

When I first saw his code, it seemed impossible to understand, but with a little of help I understood it and started to change what I though it worked.

There was a really big problem, which from my “circle” I was the first to suffer: “segmentation fault (core dumped)” after compiling and . First I though it was my compiler, but then everybody started to get it. So, after some hours spent with Omar, Alejandra, and Newton trying to fix it, until we realized that it was a problem with big pictures, which we couldn’t fix.

But after all this hours spent, it was done. And since now, and for the next years, every time I get involved in something hard like this, there’s one simple quote I will remember :”It’s OK to fail”.

 

  1. http://stackoverflow.com/questions/28151240/get-rgb-color-with-magick-using-c
  2. http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/
  3. http://www.smashingmagazine.com/2015/06/efficient-image-resizing-with-imagemagick/

CC BY 4.0 Final final project post by eduardomacielm is licensed under a Creative Commons Attribution 4.0 International License.