amazfitbip / tools

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

res2img testing - new res size #13

Closed edpf closed 7 years ago

edpf commented 7 years ago

Hi everybody. first of all congrats for your work and thanks

I am testing res2img.py and i found one issue. My testing:

1 - Run res2img.py -u 2 - change all raw files so they are generated again 3 - Run res2img.py -p

Original res file size was 228656 bytes and new res file size is 373207. That is without changing any of the images: all the images are the original ones extracted in step 1.

Further analysis shows that every new raw has exactly double size of the original one (header excluded) and I think that is related with depth of the images extracted which seem to double the original depth read from the original res file

I suppose there should be a limit in memory space in the amazfit, so this colud be a issue

Could you check it?

dpeddi commented 7 years ago

Give a try now using -f png

edpf commented 7 years ago

Trying with - f png Sorry, but PNGs I got are not fully decoded:

imagen

dpeddi commented 7 years ago

just tested with gimp and it works correctly. What editor are you using?

edpf commented 7 years ago

I am at work and I only have access to my linux console at home, so I am generating PNGs under linux, but viewing images in Windows. I get same results with embedded viewer, with photo app and with Paint (all of them from Microsoft). With ImageMagick Display under Windows I get the following error:

imagen

heartlandzf commented 7 years ago

The embedded decoder and others don't accept the crc..

I made some test on few pixel and it was working, but there is something to fix.

But, please, confirm if images in gimp are fully decoded

edpf commented 7 years ago

Testing images with gimp under windows --> gimp open images but I wonder if there is a problen in the last line of each image. Look at the images compared with BMPs generated with a prevoius version of res2img.py (left images are new pngs and on the right side bmps). Last line of pixels in pngs seems to be incorrect

imagen

heartlandzf commented 7 years ago

Should be Fixed now ..

JDesing commented 7 years ago

Hi, I try to extract the BMP files with the new res2img.py but not decode them correctly

fix_bmp

edpf commented 7 years ago

Wow! Great job! Now almost everything seems to work right ;-) Just a few comments:

Anyway, the main reason of this issue was that size of packed images was twice the size of unpacked images and that problem is solved. Sorry for being so hard testing your script, but uploading firmware files whose size is bigger than expected is a typical way of bricking devices. So I think you did a great improvement!!!!

heartlandzf commented 7 years ago

@JDesing : Png conversion are done directly while other formats use 'imagemagick'. Imagemagick is probably the most powerful tool I know, but the use of multiple functions produce some unexpected problems. I don't know if we can fix other formats, but with png we have more control over the output.

@edpf: 1) later or tomorrow I check.. I'll upload the new version with compressed png support 2) If transparent bit is set, the first entry in colormap is .. transparent .. I choose to represent transparent color with rgb( 254, 254, 0) as first element in the png colormap. Converting to raw, if first value is (254,254,0) , transparent bit is set and the rgb value is not a problem. Please note that it looks like display has 8 colors and official resources only use 0 or 255 for color components.

I hope that all works well!

JDesing commented 7 years ago

@heartlandzf

Ok, thanks for the reply. The problem is that if I modify some PNG is not seen correctly in the Amazfit Bip, the modified PNG is seen only grabs. However, if I use the BMP and although they are not well decoded in the PC, then in the Amazfit Bip is seen correctly. I have tried several ways to save in PNG but none works for me. I will continue to use BMP.

Thanks and best regards.

kingdj commented 3 years ago

Hey any one knows how to design custom watchface for amazfit bip u.