Affine transformation of image