amazfitbip/tools

res2img.py - the newest, Windows, Python 2.7

Closed this issue · 6 comments

I have got problem with the newest script res2img.py in Windows. When I try to unpack a *.res file (-i test.res -u) have got that error:

Traceback (most recent call last):
File "test.py", line 386, in
raw2png(index)
File "test.py", line 298, in raw2png
PLTE_len='\x00\x00\x00'+chr(len(PLTE_chunk))
ValueError: chr() arg not in range(256)

I can fix the problem, anyway the res file is not well made because Bip display only has 8 colors, using 4 bytes for color we have a palette of 32 bytes. If the palette is more than 256 bytes, this res has colors that can't be seen.

Thus the res is bigger than it should be.

What is the res with problems?

resource 113 is using about 128 colors, while display only has 8 colors (white, black, cyan, blue, magenta, red, yellow, green) you can reduce the colors of the image ( with gimp for example)

We didn't check for that, but the info is in the comments

We can update the README to explain this