How to apply a 2D -2D homography matrix to an image?
What do you mean by "apply this matrix to all pixels of the image without treating them one by one"?

The image is made of pixels, each one with its x-y location. The homography maps a coordinate on a plane into another one so you actually HAVE to apply it to every single pixel

(x' ; y' ; 1) = H (x ; y ; 1)


where H is your 3x3 homography matrix. Doing this you'll get the new image (plus some black areas), simply iterate the equation for every pixel in the image.

(sorry for the bad formatting of the formula, wrote it down fast)