Page 1 of 1

[ANALOG] Mix-colored hands

Posted: 24 Sep 2019, 11:47
by IamFensterbredl
Hey Guys,

I ran into a problem...

How can I program two colored hands on my analog WF. (White and grey, see original @attachment)

Or can it only be done by making it with a PNG file?

Thanks!

Re: [ANALOG] MIx-colored hands

Posted: 24 Sep 2019, 12:27
by lvpokka
Allowed only using segments, images not rotating

Re: [ANALOG] MIx-colored hands

Posted: 26 Sep 2019, 06:57
by IamFensterbredl
Ah ok,

But can I program that?
Do you have any idea?

"Minutes": {
"OnlyBorder": false,
"Color": "0xCACACA",
Where can I put in more colors and their positions on the hand?
"Center": {


Thanks.

Re: [ANALOG] MIx-colored hands

Posted: 26 Sep 2019, 07:33
by lumenvindex
You can't put other colors. Neither packer nor Mi Band will be able to process it.

Re: [ANALOG] Mix-colored hands

Posted: 26 Sep 2019, 09:32
by IamFensterbredl
Thanks for your reply.
Can I make two second hands then?
logically it should be possible...

one like this in grey
"Shape": [
{
"X": 0,
"Y": 0
},
{
"X": 25,
"Y": 0
},
{
"X": 0,
"Y": 0
}
],

the other in white
"Shape": [
{
"X": 25,
"Y": 0
},
{
"X": 55,
"Y": 0
},
{
"X": 25,
"Y": 0
}


Something like a workaround?

Re: [ANALOG] Mix-colored hands

Posted: 26 Sep 2019, 09:36
by lvpokka
Why your asking?)) try!

1 color per hand, 3 hands, no images - just segments

Re: [ANALOG] Mix-colored hands

Posted: 26 Sep 2019, 09:40
by IamFensterbredl
I already tried and failed...
I wouldn't ask, if I didn't try already ;)

It just gives me the second white one as a gif output.

"AnalogDialFace": {
"Hours": {
"OnlyBorder": false,
"Color": "0xAAAAAA",
"Center": {
"X": 60,
"Y": 118
},
"Shape": [
{
"X": 0,
"Y": 0
},
{
"X": 0,
"Y": -1
},
{
"X": 35,
"Y": -1
},
{
"X": 35,
"Y": 0
},
{
"X": 35,
"Y": 1
},
{
"X": 0,
"Y": 1
}
],
"CenterImage": {
"X": 54,
"Y": 109,
"ImageIndex": 11
},
},
"Minutes": {
"OnlyBorder": false,
"Color": "0xAAAAAA",
"Center": {
"X": 60,
"Y": 118
},
"Shape": [
{
"X": 0,
"Y": 0
},
{
"X": 0,
"Y": -1
},
{
"X": 55,
"Y": -1
},
{
"X": 55,
"Y": 0
},
{
"X": 55,
"Y": 1
},
{
"X": 0,
"Y": 1
}
]
},
"Seconds": {
"OnlyBorder": false,
"Color": "0xAAAAAA",
"Center": {
"X": 60,
"Y": 118
},
"Shape": [
{
"X": 0,
"Y": 0
},
{
"X": 25,
"Y": 0
},
{
"X": 0,
"Y": 0
}
],
"CenterImage": {
"X": 55,
"Y": 112,
"ImageIndex": 12
},
},
"Seconds": {
"OnlyBorder": false,
"Color": "0xFBFBFB",
"Center": {
"X": 60,
"Y": 118
},
"Shape": [
{
"X": 25,
"Y": 0
},
{
"X": 55,
"Y": 0
},
{
"X": 25,
"Y": 0
}
]
},
}

Re: [ANALOG] Mix-colored hands

Posted: 26 Sep 2019, 09:43
by IamFensterbredl
1 color per hand, 3 hands, no images - just segments

got it
I overread that part.

Re: [ANALOG] Mix-colored hands

Posted: 26 Sep 2019, 11:34
by IamFensterbredl
Anyways, I am trying to figure out the issue here, but it just won't work.

The same hand, but 2 different instances.

I took away the minute hand so I have 3 hands (1 hour;2 second) in total but no change.


.bin for further testing is attached if anyone is bored enough to care.

The finished one with one color is here:
https://amazfitwatchfaces.com/mi-band-4/view/7211


[mention]lvpokka[/mention]
Is the standard in general "1 color per hand, 3 hands, no images" or just for MiBand4?
I saw BIP devices with different colored hands as .PNG files for example, that's why I assumed it would work for MiBand4 as well.

Re: [ANALOG] Mix-colored hands

Posted: 26 Sep 2019, 12:16
by lumenvindex
As I've heard, the CenterImage PNG on BIP was able to rotate with hands.
This feature is disabled on Mi Band - CenterImage stands still.

Re: [ANALOG] Mix-colored hands

Posted: 08 Oct 2019, 13:25
by eastsuntecords
two colors not posible, but you can try this

"Hours": {
"OnlyBorder": false,
"Color": "0xf8f5f0",
"Center": {
"X": 60,
"Y": 120
},
"Shape": [
{
"X": -12,
"Y": -3
},

{
"X": -12,
"Y": 3
},

{
"X": 45,
"Y": 3
},
{
"X": 45,
"Y": 2
},



{
"X": 8,
"Y": 2
},

{
"X": 8,
"Y": -2
},


{
"X": 34,
"Y": -2
},

{
"X": 34,
"Y": 2
},

{
"X": 45,
"Y": 2
},


{
"X": 45,
"Y": -3
}
]
},
"Minutes": {
"OnlyBorder": false,
"Color": "0xf8f5f0",
"Center": {
"X": 60,
"Y": 120
},
"Shape": [
{
"X": -12,
"Y": -3
},

{
"X": -12,
"Y": 3
},

{
"X": 85,
"Y": 3
},
{
"X": 85,
"Y": 2
},



{
"X": 18,
"Y": 2
},

{
"X": 18,
"Y": -2
},


{
"X": 74,
"Y": -2
},

{
"X": 74,
"Y": 2
},

{
"X": 85,
"Y": 2
},


{
"X": 85,
"Y": -3
}
]
},
"Seconds": {
"OnlyBorder": false,
"Color": "0xe01212",
"Center": {
"X": 60,
"Y": 120
},
"Shape": [
{
"X": -13,
"Y": -1
},
{
"X": 95,
"Y": -1
},
{
"X": 95,
"Y": 0
},
{
"X": -13,
"Y": 0

Re: [ANALOG] Mix-colored hands

Posted: 15 Oct 2019, 10:42
by IamFensterbredl
Thanks [mention]eastsuntecords[/mention] !
That was the first thing I did to make the hands "hollow".
Make the hands white in general, tips full white and then just make the part to the center hollow, so the dial can work as the grey/silver part.
But I didn't really like it, so I left it full silver.

But in the end the problem was that I wanted to make it as real as possible... (grey with white tips)
which for now, will stay impossible sadly :D

Re: [ANALOG] Mix-colored hands

Posted: 16 Oct 2019, 22:30
by jellynettle
Maths to rescue! Here's what I came up with, packed with selective pallette mode + gimp source

Re: [ANALOG] Mix-colored hands

Posted: 02 Nov 2019, 23:13
by IamFensterbredl
This is great stuff!
Thanks [mention]jellynettle[/mention] !

But to be fair...
I have no clue what you actually did (in gimp).
Also I'm useless in math :lol:

Could you make a more in-depth explanation of the steps you took?
It looks to me like the most part is done in gimp...
The grey part is only filling up the white parts of the watch hands, that you defined with the small circle layer you cut from the dial.

I get the actual cutouts you did, but how the layering and the cutouts interact is going way over my head. :shock:

Also did you use palette mode on purpose?


I think this info would be very useful for a lot of analog wf-makers.
As small as this solution might seem, you kinda broke the MiBand4 boundaries my friend :twisted:

Re: [ANALOG] Mix-colored hands

Posted: 05 Nov 2019, 18:04
by jellynettle
Fair enough, I explained nothing and frankly the gimp file is a piece of crap as I'm only a beginner with gimp.

The idea and math is really simple. Stacking image (i) with transparency (α) over some background (b), the final pixel value (p) is usually calculated simply as p = α·i + (1-α)·b
What we need is to have the final value equal to original background (p = ob) and use image i to tint anything put in between so we can solve for b = (ob - α·a)/(1-α)
Now you can put this equation into python pil or imgemagick to generate the image, or try to find a layer mode that applies said function in graphics program of your choice (found only some similar function and cohered it to cooperation, definitely can be done more elegantly. I'm adding second gimp file that explains it better)

Now to the limitations, this is kind of limited solution and can only work if all the values of your background and overlay images stay in the range supported by png format (and the miband) so for example tinting the hands on black background probably isn't possible.

I've used pallette mode just to show the alpha channel is only necessary on the overlay image