Quote: "It works something like :
Get a byte. Get another byte. If the two are the same then read a byte until the value read is different from the starting two. You then store the number of duplicates, after storing the intitial 2 bytes."
Thank for the replies guys
That was initial idea, the challenge would be to code it (it sounds so simple on paper, yet my first attempt was rubbish).
Currently I'm saving an image from the screen, so I have a 2D array to play with. However, when I modify it to read directly from a bitmap, it'll be easier then
IanM: I don't understand about how using 32-bit values can trap repeating colours (I don't understand much about bytes actually, apart from how much they can hold and the binary logic behind them) but if it helps here's the file format at the moment:
// Header
1 byte width
1 byte height
1 word number of colours in palette
// Palette
1 long for each colour in palette
// Image
1 word for each x,y position indicating colour token in palette
There's no place like 127.0.0.1
There are 10 people in this world, those who understand binary and those who don't.