Affine transformation of an image