I use 16 bits to encode one color, one operation, and a counter
9 bits = R,G,B
1 bit = operation (point or rectangle)
6 bits = number N of pionts/rectangles that will use this color
the following N*16 bits store the points/rectangles:
if point, it will store 2 pixels per 16 bits:
4 bits for the x1 coordinate
4 bits for the y1 coordinate
4 bits for the x2 coordinate
4 bits for the y2 coordinate
if a rectangle, it will store one rectangle per 16 bits:
4 bits for the x1 coordinate
4 bits for the y1 coordinate
4 bits for the width
4 bits for the height
the image must be exactly 16x16, and the color 255,0,255 means transparency.
I made my converter to output one framefor each step it took to build a particular image. Each frame means 2 bytes, and a P means the next operation will be points (of that color), and an R rectangles:



I hoped it would be a great compression method compared to a index color palette and never really had a chance to benchmark it until now, and I must confess I'm a little disappointed to see that the gain is so small
It was fun to develop it anyway