• Administrator
  •  
    Support Ukraine
    If you experience any problems with the forum (it is not visible, there is no way to post messages, or some functionality does not work), please let us know. If you have problems with registration or you did not receive confirmation letter, let us know and we will activate your account manually.
    If you get an "The submitted form was invalid. Try submitting again" error, delete cookies, then try again.
     

py amazfit tool

This forum is designed to discuss and develop tools creating watch faces.

Moderators: asoo, lvpokka, Internal error, Watchmens

Forum rules
All communication in this branch should only be in English.
To discuss tools that are not in this section, use the “Watchfaces tools (discussion)” forum.
afwafwafw
Posts: 32
Joined: 21 Feb 2019, 02:55
Location: on earth
Has thanked: 6 times
Been thanked: 14 times
Contact:

py amazfit tool

Post by afwafwafw »

https://github.com/lolyinseo/py_amazfit ... ee/dev_gtr
https://github.com/ghtalpo/amazfit_verge_lite_tools

what is...
  • can pack/unpack .bin file for amazfit verge lite/gtr(original watchfaces)
what isn't...
  • 100% compatibility with amazfit_bip_tool
  • 100% compatibility with .json structures of bip
requirements
  • python3(tested on 3.7.4)
  • pillow(tested on 6.1.0)

Code: Select all

## usage
* for verge lite
  * see scripts folder
    * to unpack
      * python main.py WATCH_FACE_FILE.bin
    * to pack
      * python main.py WATCH_FACE_FILE.json
    * to convert from extracted GTR watchface(experimental BIP support also)
      * python convert.py EXTRACTED_WATCH_FACE_FOLDER
  * for windows users(experimental) : USE AT YOUR OWN RISK
    * copy & unzip amazfit_verge_lite_tools_WIN32.zip from release/win32
      * to pack
        * drag & drop WATCH_FACE_FILE.json into main/main.exe
      * to unpack
        * drag & drop WATCH_FACE_FILE.bin into main/main.exe
      * to convert from extracted GTR watchface(experimental BIP support also)
        * drag & drop EXTRACTED_WATCH_FACE_FOLDER into convert/convert.exe
* for GTR
  * to unpack
    * python main.py --gtr WATCH_FACE_FILE.bin
  * to pack
    * python main.py --gtr WATCH_FACE_FILE.json
  * for windows users(experimental) : USE AT YOUR OWN RISK
    * copy & unzip amazfit_gtr_tools_WIN32.7z from release/win32
      * to pack
        * drag & drop WATCH_FACE_FILE.json into main_gtr/main.exe
      * to unpack
        * drag & drop WATCH_FACE_FILE.bin into main_gtr/main.exe
It's a python port of Валерий Миронов's AmazfitBipTools(v.1.0.3.1) with some hacks.

Have a fun and feel free to give me some feeback.
Pinkabou
WF maker
Posts: 4
Joined: 03 Apr 2018, 22:21
Has thanked: 2 times
Contact:

Post by Pinkabou »

Did you have a GTS version ?

I try your soft but have a error. My .Bin file is a GTS watchFace
ajs
WF maker
Posts: 5
Joined: 30 Oct 2019, 11:02
Has thanked: 3 times
Been thanked: 1 time
Contact:

Post by ajs »

Horatius80 wrote: 11 Nov 2019, 16:49
HI I do not know how to contact lolyinseo directly, but in his last dev-gtr the battery scale is not working...
I wrote to him about this problem, if there is any answer. I’ll let you know, or maybe he will write it himself.
Horatius80

Post by Horatius80 »

It is OK, I've already figured it out. There are syntax differences in the *.json between GTR and DEV-GTR version .. that was the problem ... here is watchface that works as I wanted

https://amazfitwatchfaces.com/gtr/view/2040
H078
WF maker
Posts: 7
Joined: 29 Oct 2019, 22:22
Contact:

Post by H078 »

Any recommendations on how to keep .bin under 2Mb?

I was making digital watch and size of .bin file kept increasing eventhough all images put together are at most 500kb.
hikashi
WF maker
Posts: 16
Joined: 18 Nov 2019, 14:48
Has thanked: 1 time
Been thanked: 14 times
Contact:

Post by hikashi »

Any plans to port in hearts and linear scale i.e. segments? I tried to port in with new elements using the c# as reference but to no avail.
Im not too sure what is the equivalent of list<xy> to python.
pacomar
WF maker
Posts: 2
Joined: 11 May 2018, 10:01
Contact:

Post by pacomar »

H078 wrote: 29 Nov 2019, 08:21
Any recommendations on how to keep .bin under 2Mb?

I was making digital watch and size of .bin file kept increasing eventhough all images put together are at most 500kb.
reducing the number and size in pixels of png files.
Horatius80

Post by Horatius80 »

pacomar wrote: 03 Dec 2019, 15:46
H078 wrote: 29 Nov 2019, 08:21
Any recommendations on how to keep .bin under 2Mb?

I was making digital watch and size of .bin file kept increasing eventhough all images put together are at most 500kb.
reducing the number and size in pixels of png files.
... :idea: Or do not use antialiasing to prevent occurrence of semitransparent and partially transparent pixels, reduce the number of colors per image, color palette has to be RGB and using maximal PNG compression ... :idea:
dpassaggio
WF maker
Posts: 18
Joined: 28 Aug 2018, 19:18
Location: unknown
Been thanked: 1 time
Contact:

Post by dpassaggio »

Hi guys, I just tried the Gts version of this tools in python, but I find myself with the same error I had with the gtr version, or following the whole unpack guide, I get the following error

Code: Select all

Traceback (most recent call last):
  File "main.py", line 4, in <module>
    from watchFaceParser.config import Config
ImportError: No module named watchFaceParser.config
how do I fix it? :roll:
DJArty

Post by DJArty »

dpassaggio wrote: 04 Dec 2019, 18:42
.. same error

Code: Select all

Traceback (most recent call last):
ImportError: No module named watchFaceParser.config
+1 have same error (Ubuntu 16.04 x64)


*****************

P.S. but maybe its because default "python main.." starts python ver 2.7 so may be just need start like "python3 main ..."

P.P.S. Yes need start

Code: Select all

python3.7 main_py --gts --file watchface_bin  
and pillow 6+ for python3.7
Last edited by DJArty on 10 Dec 2019, 07:53, edited 1 time in total.
hikashi
WF maker
Posts: 16
Joined: 18 Nov 2019, 14:48
Has thanked: 1 time
Been thanked: 14 times
Contact:

Post by hikashi »

H078 wrote: 29 Nov 2019, 08:21
Any recommendations on how to keep .bin under 2Mb?

I was making digital watch and size of .bin file kept increasing eventhough all images put together are at most 500kb.
500kb is too big
> Reuse asset i.e. same 'number' asset for different element like date, activity
> Use assets with smaller dimension
> Use 266 pixel size for the 0001 preview asset

Cheers!
Luizneto100
WF maker
Posts: 1
Joined: 09 Dec 2019, 01:53
Has thanked: 1 time
Contact:

Post by Luizneto100 »

I'm new, help me, because every time I pack, the bin comes out with a different color from the original? Ex: Green color dial; Installed: Turns Red.
H078
WF maker
Posts: 7
Joined: 29 Oct 2019, 22:22
Contact:

Post by H078 »

What are acceptable transparecy levels for .png files? I tried 32bit and anything lower than that tool throws an error in a log file " invalid transparecy mask".
32bit transparecy generally increases file size in kb.
schwedenpaule
Posts: 1
Joined: 17 Dec 2019, 19:14
Location: USA
Contact:

Post by schwedenpaule »

hikashi wrote: 10 Dec 2019, 00:52
H078 wrote: 29 Nov 2019, 08:21
Any recommendations on how to keep .bin under 2Mb?

I was making digital watch and size of .bin file kept increasing eventhough all images put together are at most 500kb.
500kb is too big
but why is 500kb too big ? For me it seems there is something unnecessary in the bin-file.. or the images are rewritten NOT compressed (if I have 2 bigger images in, the .bin-size increases more than the filesize of the two bigger images!)..
Is there something that can be left out, like the preview gif ? I tried modifiying the python script setting the size of the gif to 1x1, sadly has no effect to the bin-size. Other ideas ?
hikashi
WF maker
Posts: 16
Joined: 18 Nov 2019, 14:48
Has thanked: 1 time
Been thanked: 14 times
Contact:

Post by hikashi »

schwedenpaule wrote: 18 Dec 2019, 17:25
hikashi wrote: 10 Dec 2019, 00:52
H078 wrote: 29 Nov 2019, 08:21
Any recommendations on how to keep .bin under 2Mb?

I was making digital watch and size of .bin file kept increasing eventhough all images put together are at most 500kb.
500kb is too big
but why is 500kb too big ? For me it seems there is something unnecessary in the bin-file.. or the images are rewritten NOT compressed (if I have 2 bigger images in, the .bin-size increases more than the filesize of the two bigger images!)..
Is there something that can be left out, like the preview gif ? I tried modifiying the python script setting the size of the gif to 1x1, sadly has no effect to the bin-size. Other ideas ?
Unfortunately we have to work around with the 2 mb limit. The biggest contributor to the bin size is the asset dimension size regardless of content or quality of compression.
hikashi
WF maker
Posts: 16
Joined: 18 Nov 2019, 14:48
Has thanked: 1 time
Been thanked: 14 times
Contact:

Post by hikashi »

Sharing some working syntax with analog dial.
"DaysProgress": {
"AnalogMonth": {
"OnlyBorder": false,
"Color": "0x00000000",
"CenterOffset": {
"X": 84,
"Y": 0
},
"Shape": {
"X": 0,
"Y": 0
},
"Sector": {
"StartAngle": 0,
"EndAngle": 33000
},
"Image": {
"X": 5,
"Y": 44,
"ImageIndex": 12
}
},
"AnalogDOW": {
"OnlyBorder": false,
"Color": "0x00000000",
"CenterOffset": {
"X": 0,
"Y": 92
},
"Shape": {
"X": 0,
"Y": 0
},
"Sector": {
"StartAngle": 0,
"EndAngle": 30858
},
"Image": {
"X": 5,
"Y": 35,
"ImageIndex": 13
}
}
},
"StepsProgress": {
"ClockHand": {
"OnlyBorder": false,
"Color": "0x00000000",
"CenterOffset": {
"X": -84,
"Y": 0
},
"Shape": {
"X": 0,
"Y": 0
},
"Sector": {
"StartAngle": -15000,
"EndAngle": 15000
},
"Image": {
"X": 5,
"Y": 44,
"ImageIndex": 13
}
}
},
Louis_Cypher
WF maker
Posts: 2
Joined: 28 Dec 2019, 14:46
Location: Macapá
Has thanked: 1 time
Been thanked: 1 time
Contact:

Post by Louis_Cypher »

schwedenpaule wrote: 18 Dec 2019, 17:25
hikashi wrote: 10 Dec 2019, 00:52
H078 wrote: 29 Nov 2019, 08:21
Any recommendations on how to keep .bin under 2Mb?

I was making digital watch and size of .bin file kept increasing eventhough all images put together are at most 500kb.
500kb is too big
but why is 500kb too big ? For me it seems there is something unnecessary in the bin-file.. or the images are rewritten NOT compressed (if I have 2 bigger images in, the .bin-size increases more than the filesize of the two bigger images!)..
Is there something that can be left out, like the preview gif ? I tried modifiying the python script setting the size of the gif to 1x1, sadly has no effect to the bin-size. Other ideas ?
Resizing 001.png (the preview image) to 266 pixels reduced my .bin from 2mb to 1,5mb. Perhaps making it even smaller can decrease .bin for less than 1mb (I didn't try yet).
It looks like the problem is with .gif created during packing. It uses 10 frames, and I think it's not compressed.
hikashi
WF maker
Posts: 16
Joined: 18 Nov 2019, 14:48
Has thanked: 1 time
Been thanked: 14 times
Contact:

Post by hikashi »

Louis_Cypher wrote: 31 Dec 2019, 09:43
schwedenpaule wrote: 18 Dec 2019, 17:25
hikashi wrote: 10 Dec 2019, 00:52

500kb is too big
but why is 500kb too big ? For me it seems there is something unnecessary in the bin-file.. or the images are rewritten NOT compressed (if I have 2 bigger images in, the .bin-size increases more than the filesize of the two bigger images!)..
Is there something that can be left out, like the preview gif ? I tried modifiying the python script setting the size of the gif to 1x1, sadly has no effect to the bin-size. Other ideas ?
Resizing 001.png (the preview image) to 266 pixels reduced my .bin from 2mb to 1,5mb. Perhaps making it even smaller can decrease .bin for less than 1mb (I didn't try yet).
It looks like the problem is with .gif created during packing. It uses 10 frames, and I think it's not compressed.
Yes. The 266 sized png is meant for 0001.
The gif created is not part of the bin file.
aliense
WF maker
Posts: 2
Joined: 01 Jan 2020, 13:49
Location: Warszawa
Contact:

Post by aliense »

Why sometimes when i try unpack bin i got this err:
2020-01-04 16:07:49,979 - root - DEBUG - Opening watch face 'gtr.bin'
2020-01-04 16:07:49,979 - root - DEBUG - Reading parameters...
2020-01-04 16:07:49,979 - root - INFO - Reading header...
2020-01-04 16:07:49,988 - root - INFO - Header was read:
2020-01-04 16:07:49,988 - root - INFO - Signature: b'O3\x04\x00\x00\x00\x10', Unknown: 3725067530, ParametersSize: 308940802, isValid: False
2020-01-04 16:07:49,988 - root - DEBUG - Parsing parameters...
2020-01-04 16:07:49,988 - root - CRITICAL - 'Reader' object has no attribute '_parameters'
Traceback (most recent call last):
File "C:\Users\alien\Desktop\Zegarek\py_amazfit_tools-master\program*py", line 161, in parseResources
return ParametersConverter.parse(WatchFace, reader.getParameters())
File "C:\Users\alien\Desktop\Zegarek\py_amazfit_tools-master\watchFaceParser\reader*py", line 12, in getParameters
return self._parameters
AttributeError: 'Reader' object has no attribute '_parameters'
afwafwafw
Posts: 32
Joined: 21 Feb 2019, 02:55
Location: on earth
Has thanked: 6 times
Been thanked: 14 times
Contact:

Post by afwafwafw »

aliense wrote: 04 Jan 2020, 15:11
Why sometimes when i try unpack bin i got this err:
2020-01-04 16:07:49,979 - root - DEBUG - Opening watch face 'gtr.bin'
2020-01-04 16:07:49,979 - root - DEBUG - Reading parameters...
2020-01-04 16:07:49,979 - root - INFO - Reading header...
2020-01-04 16:07:49,988 - root - INFO - Header was read:
2020-01-04 16:07:49,988 - root - INFO - Signature: b'O3\x04\x00\x00\x00\x10', Unknown: 3725067530, ParametersSize: 308940802, isValid: False
2020-01-04 16:07:49,988 - root - DEBUG - Parsing parameters...
2020-01-04 16:07:49,988 - root - CRITICAL - 'Reader' object has no attribute '_parameters'
Traceback (most recent call last):
File "C:\Users\alien\Desktop\Zegarek\py_amazfit_tools-master\program*py", line 161, in parseResources
return ParametersConverter.parse(WatchFace, reader.getParameters())
File "C:\Users\alien\Desktop\Zegarek\py_amazfit_tools-master\watchFaceParser\reader*py", line 12, in getParameters
return self._parameters
AttributeError: 'Reader' object has no attribute '_parameters'
There's a issue with negative values for spacing or positions.

I've fixed some but let me know if you still have this issue with latest codes.
vadim.t
Posts: 1
Joined: 05 Jan 2020, 23:42
Location: Stockholm
Contact:

Post by vadim.t »

afwafwafw wrote: 04 Jan 2020, 15:29
aliense wrote: 04 Jan 2020, 15:11
Why sometimes when i try unpack bin i got this err:
2020-01-04 16:07:49,979 - root - DEBUG - Opening watch face 'gtr.bin'
2020-01-04 16:07:49,979 - root - DEBUG - Reading parameters...
2020-01-04 16:07:49,979 - root - INFO - Reading header...
2020-01-04 16:07:49,988 - root - INFO - Header was read:
2020-01-04 16:07:49,988 - root - INFO - Signature: b'O3\x04\x00\x00\x00\x10', Unknown: 3725067530, ParametersSize: 308940802, isValid: False
2020-01-04 16:07:49,988 - root - DEBUG - Parsing parameters...
2020-01-04 16:07:49,988 - root - CRITICAL - 'Reader' object has no attribute '_parameters'
Traceback (most recent call last):
File "program*py", line 161, in parseResources
return ParametersConverter.parse(WatchFace, reader.getParameters())
File "\watchFaceParser\reader*py", line 12, in getParameters
return self._parameters
AttributeError: 'Reader' object has no attribute '_parameters'
There's a issue with negative values for spacing or positions.

I've fixed some but let me know if you still have this issue with latest codes.
Hi! Thank you for this amazing tool! I would like to make few changes to the standard watch face "Orange light" provided for GTR 47, but I get the same error while unpacking a bin file (I use the latest version of your app). Can you please advise? The file is on google drive /open?id=1NE8sYuYnihxpFVJVB8-51Lv9Ud_EIDAO

Here is a fragment of my log:
2020-01-06 00:37:18,502 - root - INFO - Header was read:
2020-01-06 00:37:18,502 - root - INFO - Signature: b'O\xc8\x05\x00\x00\x00\x10', Unknown: 2735211786, ParametersSize: 305074177, isValid: False
2020-01-06 00:37:18,502 - root - DEBUG - Parsing parameters...
2020-01-06 00:37:18,503 - root - CRITICAL - 'Reader' object has no attribute '_parameters'
Traceback (most recent call last):
File "program*py", line 161, in parseResources
afwafwafw
Posts: 32
Joined: 21 Feb 2019, 02:55
Location: on earth
Has thanked: 6 times
Been thanked: 14 times
Contact:

Post by afwafwafw »

vadim.t wrote: 06 Jan 2020, 00:02
afwafwafw wrote: 04 Jan 2020, 15:29
aliense wrote: 04 Jan 2020, 15:11
Why sometimes when i try unpack bin i got this err:
There's a issue with negative values for spacing or positions.

I've fixed some but let me know if you still have this issue with latest codes.
Hi! Thank you for this amazing tool! I would like to make few changes to the standard watch face "Orange light" provided for GTR 47, but I get the same error while unpacking a bin file (I use the latest version of your app). Can you please advise? The file is on google drive /open?id=1NE8sYuYnihxpFVJVB8-51Lv9Ud_EIDAO

Here is a fragment of my log:
2020-01-06 00:37:18,502 - root - INFO - Header was read:
2020-01-06 00:37:18,502 - root - INFO - Signature: b'O\xc8\x05\x00\x00\x00\x10', Unknown: 2735211786, ParametersSize: 305074177, isValid: False
2020-01-06 00:37:18,502 - root - DEBUG - Parsing parameters...
2020-01-06 00:37:18,503 - root - CRITICAL - 'Reader' object has no attribute '_parameters'
Traceback (most recent call last):
File "program*py", line 161, in parseResources
It seems like compressed bin.

Normal bin should have 'HMDIAL' for signature field as far as I know.

Maybe SashaCX75's tool can decompress these kind of .bin. ( viewtopic.php?f=29&t=1076 )

Is there any open explanation for compression used in these format? I want to know.
Horatius80

Post by Horatius80 »

Horatius80 wrote: 06 Jan 2020, 11:49
Hi,

i downloaded original Amazfit Rainbow Watchface, but after decompression and decompilation I found that there are some new functions (new form of progress circle for calories, hearth rate, steps and battery) Is here somebody who can analyze what is the correct syntax for these kind of progress circles ? Because the accessible tools are not decompiling these commands correctly ... thank you in advance ...
Attachments
Amazfit_RainbowCircle.zip
(149.7 KiB) Downloaded 337 times
afwafwafw
Posts: 32
Joined: 21 Feb 2019, 02:55
Location: on earth
Has thanked: 6 times
Been thanked: 14 times
Contact:

Post by afwafwafw »

Horatius80 wrote: 06 Jan 2020, 11:51
Horatius80 wrote: 06 Jan 2020, 11:49
Hi,

i downloaded original Amazfit Rainbow Watchface, but after decompression and decompilation I found that there are some new functions (new form of progress circle for calories, hearth rate, steps and battery) Is here somebody who can analyze what is the correct syntax for these kind of progress circles ? Because the accessible tools are not decompiling these commands correctly ... thank you in advance ...
This one also looks like compressed one.

Not normal(uncompressed) header.
kampanita
WF maker
Posts: 34
Joined: 25 Oct 2019, 06:15
Has thanked: 8 times
Been thanked: 7 times
Contact:

Post by kampanita »

I'm having trouble with this one.
Seems to be ok but does not get installed. I see no error but does not run at watch ( gtr-47 )

If i quit weather and weekday parts, it runs ok...


https://amazfitwatchfaces.com/gtr/view/2714
User avatar
asoo
Posts: 2147
Joined: 03 Jan 2019, 01:48
Location: ͼͽ Thailand ͼͽ
Has thanked: 414 times
Been thanked: 2072 times

Post by asoo »

kampanita wrote: 07 Jan 2020, 14:25
I'm having trouble with this one.
Seems to be ok but does not get installed. I see no error but does not run at watch ( gtr-47 )

If i quit weather and weekday parts, it runs ok...


https://amazfitwatchfaces.com/gtr/view/2714
After adding "weather" and "weekday"
Your .BIN file (uncompress) size over 2M or not?
If the .BIN (uncompress) size is over 2M. It may not be able to be installed.
ͼͽ To request please use the interrelated forum in action ͼͽ
Please do not PM to me for requests ported watchface.
Post Reply

Return to “Watchfaces tools”

Who is online

Users browsing this forum: No registered users and 3 guests