The local geometry property of gray image is studied, and the local region of an image in which pixels had similar or same gray value was took as an integer, and the aim of image compression was achieved. Computer simulation experiments showed that this method could obtain higher CR (compression rate) and higher PSNR (peak signal noise rate), remove the block effect satisfactorily, keep target details effectively, and had higher practical value.