amazfitbip / tools

GNU General Public License v2.0
126 stars 57 forks source link

res2img.py - the newest, Windows, Python 2.7 #35

Closed tomurbanowicz closed 7 years ago

tomurbanowicz commented 7 years ago

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)

heartlandzf commented 7 years ago

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.

heartlandzf commented 7 years ago

What is the res with problems?

tomurbanowicz commented 7 years ago

test-problem.zip

heartlandzf commented 7 years ago

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)

tomurbanowicz commented 7 years ago

OK, but why the script packed that file into res?

Pozdrawiam,

Tomasz Urbanowicz http://www.urbanowicz.net.pl http://blog.urbanowicz.net.pl http://www.facebook.com/foto.urbanowicz tel. 733 222 733

2017-09-26 11:06 GMT+02:00 heartlandzf notifications@github.com:

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)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/amazfitbip/tools/issues/35#issuecomment-332135391, or mute the thread https://github.com/notifications/unsubscribe-auth/AeXjQirouPNiot5zA4JWfENg9q_QU9mHks5smL6EgaJpZM4PjwGL .

heartlandzf commented 7 years ago

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

We can update the README to explain this