An image compression algorithm is described in this research paper. The algorithm is an extension of the run-length image compression algorithm. The implementation of this algorithm is relatively easy. This algorithm was implemented and compared with other existing popular compression algorithms. As we show in this paper, sometimes our algorithm is best in terms of saving memory space, and sometimes one of the competing algorithms is best. Once the data is in the real memory a relatively simple and fast transformation is applied to uncompress the file. In image processing and computer graphics a scene drawn on the screen requires considerable amount of RAM space. This space in todays computers is in the order of 1 Mb. To create animation it is often required that we calculate several scenes, some of them stored on the disk and considerable number of them stored in real memory. Our algorithm compresses images that ordinarily take in the order of 1 Mb of memory to a few tens of Kbs of memory thus enabling us to store many images in real memory in a relatively small space.