for completenesshere' the code that used to decompress the rle images to confirm that the algorithm was working correctly (indeedit wasn' until fixed bugs in both compression and decompressionand ' still not sure if it is perfect should have used test-driven development!)from pil import image import sys def decompress(widthheightbytes)image image new(' '(widthheight)col row for byte in bytescolor (byte > count byte ~ for in range(count)image putpixel((rowcol)colorrow + if not row widthcol + row return image with open(sys argv[ ]'rb'as filewidth int from_bytes(file read( )'little'height int from_bytes(file read( )'little'image decompress(widthheightfile read()image save(sys argv[ ]'bmp'this code is fairly straightforward each run is encoded in single byte it uses some bitwise math to extract the color of the pixel and the length of the run then it sets each pixel from that run in the imageincrementing the row and column of the next pixel to check at appropriate intervals