I'm resurrecting this thread, because I've managed to figure out by brute force how to convert the images inside a theme file (an ibitmap resource) back into an image.
First I created 65536 BMP files, each with 256 different pixels. (In other words 256 x 256 x 256 colours across all files.)
I then used pbres from the current (6.5?) SDK to build test theme files with all of those BMPs. (256 themes, so each had 65536 image resources).
I used enyby's pbres tool to unpack (-u) each resource from each test theme. BTW the SDK pbres, enyby's pbres and yuryfdr's xpbres all unpack resources identically.
I could then map every encoded byte (pixel) from every unpacked bitmap into its original color from the BMPs.
Obviously each encoded byte will map to multiple RGB pixels because 24 into 8 just doesn't work. So I computed an average RGB value for each encoded byte. (Summed the squares of each colour, divided by the number of colours)
So I now essentially have a colour palette, mapping a resource pixel into RGB.
I told you it was brute force!
It would be nice to figure out the exact bit shifting/manipulation that the SDK pbres actually does.
I'm attaching 3 PNGs from my Inkpad Color 3's Line.pbt file. The "USB" one looks pretty good to me. The "tr" one has quite a lot of colour "artifacts", so possibly that colour averaging step needs some work. The "wwrook" looks a bit odd too, but if you look at the actual resource there are strange pixels dotted over the image.