It is currently April 20th, 2024, 4:28 pm

Plugin: Chameleon

Plugins and Addons popular with the Community
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin: Chameleon

Post by jsmorley »

Yeah, the only reason I can't find a way to use this is that it seems very random about "light" vs. "dark" for both foreground and background colors. So if I just let it do its thing, it sometimes gets a really decent choice for colors, and other times the result is invisible as it's "dark on dark" if you see what I mean.

I was kinda thinking of something like this web site:

http://lokeshdhakar.com/projects/color-thief/
1.jpg
Which returns the "dominant" color, and then a color pallet. If I had something like that, with the pallet arranged "light to dark" in order, that would probably be really useful.

So child measures like

Parent=[Desktop]
Color=Dominant
Color=Pallet1
Color=Pallet2
...
Color=Pallet9

Just thinking out loud...
You do not have the required permissions to view the files attached to this post.
User avatar
Socks the Fox
Posts: 104
Joined: August 25th, 2015, 6:40 pm

Re: Plugin: Chameleon

Post by Socks the Fox »

Hm... could you send me some images that it picks dark-on-dark for? Part of the reason it can be kind of weird about which colors it picks is that it only uses a handful of colors from the image itself, with the only exception being it picking white or black for the foreground if it deems there is not enough contrast between the color it picked and the background. The primary background is the most populous color, preferring colors it finds on the edge. The foreground color should be the color most visually distant from the primary background, so if it's not picking that correctly for some images I'd like to poke around with the color selection weights to correct that.
Author of Chameleon :: Like my plugin? Consider donating! I don't need much :3
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin: Chameleon

Post by jsmorley »

Socks the Fox wrote:Hm... could you send me some images that it picks dark-on-dark for? Part of the reason it can be kind of weird about which colors it picks is that it only uses colors from the image itself, with the only exception being it picking white or black for the foreground if it deems there is not enough contrast between the color it picked and the background. The primary background is the most populous color, preferring colors it finds on the edge. The foreground color should be the color most visually distant from the primary background, so if it's not picking that correctly for some images I'd like to poke around with the color selection weights to correct that.
It's not so much that the foreground and background are both "light" or "dark". That's not exactly what I mean. What I mean is that often if the image is "dark" the background color might be either dark or light, and I can't figure out any pattern to the behavior. On a primarily "dark" image, I might want to always have a "light" background color on my skin and a "dark" foreground (text for instance). On a primarily "light" image, I might want to always have a "dark" background color on my skin and a "light" foreground (text for instance).

I'm not sure I'm explaining it well, but probably 1/3 of the time or more, the colors it picks for the two foreground and two background colors are the reverse of what I would expect, or at least what I would consider pleasing in a skin on that image.
User avatar
Socks the Fox
Posts: 104
Joined: August 25th, 2015, 6:40 pm

Re: Plugin: Chameleon

Post by Socks the Fox »

Hm. Still sounds like a color selection problem I'd like to look in to though, so examples would still be nice :3 I know I have one wallpaper that's more or less the opposite of what I'd choose though. I need to work on my test app one of these days to let me play around with selection weights without having to recompile...

As far as the preferring light backgrounds on skins with darker images, that was part of what I was considering adding an option for whether the image is lighter or darker. Combining it with conditional measures as well as the ability to choose the lightest (or darkest) of the chosen colors (which I might make as "lightest1, 2, 3, 4" or "darkest1, 2, 3, 4") would make it easier to always choose the option you want.
Author of Chameleon :: Like my plugin? Consider donating! I don't need much :3
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin: Chameleon

Post by jsmorley »

Socks the Fox wrote:Hm. Still sounds like a color selection problem I'd like to look in to though, so examples would still be nice :3 I know I have one wallpaper that's more or less the opposite of what I'd choose though. I need to work on my test app one of these days to let me play around with selection weights without having to recompile...

As far as the preferring light backgrounds on skins with darker images, that was part of what I was considering adding an option for whether the image is lighter or darker. Combining it with conditional measures as well as the ability to choose the lightest (or darkest) of the chosen colors (which I might make as "lightest1, 2, 3, 4" or "darkest1, 2, 3, 4") would make it easier to always choose the option you want.
That might be exactly what is needed.
GLing
Posts: 23
Joined: July 1st, 2015, 5:05 pm

Re: Plugin: Chameleon

Post by GLing »

Socks the Fox wrote:Interesting... for the lightest/darkest color measure would you prefer it to return the color code itself or which main measure (i.e. Foreground1, Background2)?
I think the code would work best, but either would be fine.
Socks the Fox wrote:I might possibly be able to add a measure to return whether the average brightness of the image is lighter or darker too, as a 1 or a 0...
This would be great too.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin: Chameleon

Post by jsmorley »

Using this code to test:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[ChameleonDesktop]
Measure=Plugin
Plugin=Chameleon
Type=Desktop

[DesktopBG1]
Measure=Plugin
Plugin=Chameleon
Parent=ChameleonDesktop
Format=Dec
Color=Background1

[DesktopFG1]
Measure=Plugin
Plugin=Chameleon
Parent=ChameleonDesktop
Format=Dec
Color=Foreground1

[DesktopBG2]
Measure=Plugin
Plugin=Chameleon
Parent=ChameleonDesktop
Format=Dec
Color=Background2

[DesktopFG2]
Measure=Plugin
Plugin=Chameleon
Parent=ChameleonDesktop
Format=Dec
Color=Foreground2

[MeterBG1]
Meter=Image
W=100
H=100
SolidColor=[DesktopBG1]
DynamicVariables=1

[MeterFG1]
Meter=Image
X=15
Y=15
W=70
H=70
SolidColor=[DesktopFG1]
DynamicVariables=1

[MeterBG2]
Meter=Image
X=110
Y=0
W=100
H=100
SolidColor=[DesktopBG2]
DynamicVariables=1

[MeterFG2]
Meter=Image
X=125
Y=15
W=70
H=70
SolidColor=[DesktopFG2]
DynamicVariables=1

[MeterColors1]
Meter=String
W=201
H=55
X=103
Y=25R
StringAlign=Center
FontSize=18
FontColor=[DesktopFG1]
SolidColor=[DesktopBG1]
Padding=5,5,5,5
AntiAlias=1
Text=Background 1#CRLF#Foreground 1
DynamicVariables=1

[MeterColors2]
Meter=String
W=201
H=55
X=103
Y=10R
StringAlign=Center
FontSize=18
FontColor=[DesktopFG2]
SolidColor=[DesktopBG2]
Padding=5,5,5,5
AntiAlias=1
Text=Background 2#CRLF#Foreground 2
DynamicVariables=1
Sometimes the choices are really good:
5.jpg
Sometimes they are a bit odd:
1.jpg
And sometime just not what I would expect:
2.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin: Chameleon

Post by jsmorley »

Sometimes it just doesn't have a lot of choice... :-)
1.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Socks the Fox
Posts: 104
Joined: August 25th, 2015, 6:40 pm

Re: Plugin: Chameleon

Post by Socks the Fox »

I think those color choices are mostly because the library seems to far prefer the contrast over the population.

The first image is great, yes.

The second image, the yellow-green of that bit of the cloth is the absolute most visually distant, yet saturated (so it doesn't pick the whites), with more population than the skin tones.

For the third one it seems to be picking the blue and white from the sky, and then the blacks from the shadows in the building's windows and fire escape again because it's the absolute most visually distant.

The last one is because Chameleon enforces a minimum contrast ratio between the primary background and the foregrounds, and if the ones picked don't meet that it forces the foreground that doesn't to either white (when the primary background is dark) or black (when it's light). That is working as intended. EDIT: I just realized the white text is part of the background and not a skin XD

If you could PM me links to the original images, that would help me adjust weights to pick better colors. I'll need to adjust them, probably to take population into account a bit more. The hard part is correcting those without breaking color choices for some of the other images that it currently selects perfectly for.
Author of Chameleon :: Like my plugin? Consider donating! I don't need much :3
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin: Chameleon

Post by jsmorley »

SpaceGirl.jpg
WizardGirl.jpg
destroyed.jpg
You do not have the required permissions to view the files attached to this post.