It's very naive and takes 22 seconds to decode a 100x100 encoded image on my computer!
So, if anyone fancies improving it (no JS of course) I'd be really grateful
The final image should look like this (it's a tile of part of an earthnullschool.net wind map) but the decoder must decode the simple ones as well in order to be compliant
[edit Originally it was taking 300 secs but I'd made a mistake with encoding the data in the 1st place - all OK now - output bytes should be 40,000 long if processing the tile image]