Hi guys,
This is interesting to me since I have had a similar approach in our development, and by experience, I know how useful this is. I just wanted to say thanks to @CubeCoders for making this easily available to the community.
The difference in our approach is I made a PWA client using webassembly and lvgl, which is served by the device itself so it is always available. (A screenshot of it can be found here)
For the run-length encoding, I choose the variant in which the value itself is used as an escape value and then it is followed by a 1-byte repeat count, for example:
“ABCCDDDEEEEFFFFFG” → “ABCC2DD3EE4FF5G”
The reason for choosing this is the fact that non-repeated values are used as they are so no need for an extra byte, switching characters for 3-byte pixel values, in the worst case where each of two adjacent pixels is equal, the result is 7 bytes instead of 6 bytes, so 16% extra bandwidth usage, and in the best case 7 bytes instead of 765 bytes, so 99% savings in the bandwidth.
As said this is dependent on how complicated the scene is but in our project, I’ve seen ~85% compression in general and even 20% compression when displaying a 320x240 gif.