Decoding stream containing hex-values received on Serial port.

Well I'll be; "XBM files differ markedly from most image files in that they take the form of C source files".

I was not expecting that!

Importantly "If the image width does not match a multiple of 8, the extra bits in the last byte of each row are ignored".