Transforms an image as dictated by the affine matrix.