It is currently April 28th, 2024, 10:15 am

How Does ImageTint Work?

Get help with creating, editing & fixing problems with skins
User avatar
brijamelsh
Posts: 47
Joined: July 16th, 2010, 4:24 am

How Does ImageTint Work?

Post by brijamelsh »

So I am thinking about using ImageTint, however I want to understand how it works before I commit to it.

So how does ImageTint actually work? Does it just replace the white values in an image with color? What if I have a gradient? Or alpha?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How Does ImageTint Work?

Post by jsmorley »

brijamelsh wrote:So I am thinking about using ImageTint, however I want to understand how it works before I commit to it.

So how does ImageTint actually work? Does it just replace the white values in an image with color? What if I have a gradient? Or alpha?
It adds the defined color to the colors already in the image. So it adds a "tint" of the color you specify to the existing colors. If you want to fully "colorize" the image instead, simply add GreyScale=1 on the meter as well. Then it will be desaturated first, and the ImageTint color will be applied.

Note: an ImageTint of 255,255,255 (white) in effect means "make no change". So ImageTint=255,255,255 can be used to restore the original colors of an image if you want to toggle the tint using !RainmeterSetVariable.

If you specify an alpha amount on the ImageTint statement, that alpha will be added to the image. If you have an image (.png) that already is partially transparent, this can be used to make it "more transparent". It cannot be used to make it "more opaque" however. The alpha value is added, not replaced, in the image. So an alpha of 255, much like with colors, means "make no change" and can be used to restore the original transparency of the image.

P.S. If you want finer control over the tinting / colorizing of an image meter, you might look at ColorMatrix: http://rainmeter.net/cms/Tips-ColorMatrixUnleased
User avatar
brijamelsh
Posts: 47
Joined: July 16th, 2010, 4:24 am

Re: How Does ImageTint Work?

Post by brijamelsh »

Thanks, that cleared it up nicely. I did look into ColorMatrix before deciding to try to use ImageTint but it was beyond me, at least for the time being anyways. I think it would have been overkill for what I am doing anyways.
User avatar
fabularasa
Posts: 76
Joined: February 26th, 2011, 12:51 am
Location: Poland

Re: How Does ImageTint Work?

Post by fabularasa »

How to add Gradient to ImageTint?
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: How Does ImageTint Work?

Post by smurfier »

fabularasa wrote:How to add Gradient to ImageTint?
That is not currently possible.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: How Does ImageTint Work?

Post by MerlinTheRed »

jsmorley wrote: It adds the defined color to the colors already in the image. So it adds a "tint" of the color you specify to the existing colors. If you want to fully "colorize" the image instead, simply add GreyScale=1 on the meter as well. Then it will be desaturated first, and the ImageTint color will be applied.

Note: an ImageTint of 255,255,255 (white) in effect means "make no change". So ImageTint=255,255,255 can be used to restore the original colors of an image if you want to toggle the tint using !RainmeterSetVariable.

If you specify an alpha amount on the ImageTint statement, that alpha will be added to the image. If you have an image (.png) that already is partially transparent, this can be used to make it "more transparent". It cannot be used to make it "more opaque" however. The alpha value is added, not replaced, in the image. So an alpha of 255, much like with colors, means "make no change" and can be used to restore the original transparency of the image.

P.S. If you want finer control over the tinting / colorizing of an image meter, you might look at ColorMatrix: http://rainmeter.net/cms/Tips-ColorMatrixUnleased
Perhaps I should mention that the color values are not actually "added" in a mathematical sense. Rather they are multiplied in a way. Specifying an ImageTint of 128,128,128 will effectively multiply all the color values by 0.5 (making it darker). That's the reason you can't make an image brighter or more opaque with this, because you can't add anything and you can't multiply by something larger than 1 (meaning values above 255).
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!