I'm supposed to modify this method (http://pastebin.com/6xF1pN51) to this (translated):
"A faster algorithm to compute the average can be done by looping through the entire image in two passes in each session and make a one-dimensional mean value.
In the first pass compute the mean value of the y-axis (one dimension) and in the second calculate the mean in x direction (one dimension).
The combined effect of the two one-dimensional mean values becomes a two-dimensional mean value."
http://pastebin.com/Rvw2ZSak is what i've done.
It works but the results are a bit off if I compare it to the real method, not sure if i've done it right..
> Picture X = new Picture(FileChooser.pickAFile())
> Picture Y = new Picture(FileChooser.pickAFile())
Pixel red=40 green=74 blue=50
Pixel red=41 green=75 blue=50
X and Y == same image of course.