This paper proposes the n-dimension affine transformation based image encryption scheme, which changes the values of the pixels of an image. The property of the n-dimension affine transformation was analyzed in detail and the security of the proposed algorithm was described. The experimental results demonstrate that the suggested image encryption algorithm has the advantages of large key space and sensitivity to the secret keys. It also has the abilities of resisting brute-force attacks and statistical attacks.