Make the test suite 5x faster.

When comparing image pixels:

* Inline the get_pixel lambda
* Move it out of the loop
* Compare big chuncks (whole image, row, RGBA pixel) to avoid entering
inner loops if they are equal.

Needs review for correctness.
Merge remote-tracking branch 'remotes/origin/tests-speed'