The compression algorithm here
https://www.youtube.com/watch?v=gpsvgWsTX1I
also used in this impressive zx81 hi-res demo
https://www.youtube.com/watch?v=gpsvgWsTX1I
gives on average (for an arbitrary image) better compression than RLE. It also easy to implement. It basically summarised as follows. Suppose the image is made up of custom characters of 8 by 8 pixels and is monochrome so it needs a byte to store 1 line of the character.
1) For each tile of the character search through the ROM of the machine to find a sequence of bytes that is an exact match or a near match for those 8 bytes. Note that usually on an 8 bit machine a ROM address is stored as 2 bytes (thus it already saving 6 bytes per character). Store this ROM address.
2) Do this for every character that makes up that image
3) Store this list of ROM addresses.
Color information is compressed in a similar way. To decompress is basically the reverse of above.
However the image may look slightly "damaged" (but obviously recognisable) though this may be acceptable depending on the situation. Or the image may compress perfectly using above method. But image damage is to be expected using a lossy image compression algorithm-for example JPEG compression may visibly damages with artifacts (the reason there is because JPEG a compression algorithm acts like a filter with the cosine Fourier series). The above saves about 75 percent memory (because 2 bytes are stored instead of 8 at step 1) for an arbitrary image. The compression becomes better the bigger the system ROM is.There are obvious variations of above to try. For example representing 4 consecutive bytes in the 8 by 8 character with 2 address bytes which means four bytes will be used to represent 8 bytes. Which is still a good saving of 50% memory.
We could use a smaller ROM area which can save bytes. RLE on average would be significantly lower than 75 percent memory saving. 2-RLE is an improved variant of the RLE compression algorithm and a google search shows 2-RLE has a compression ratio of 56% (which is significantly less than 75%).