It is currently October 18th, 2024, 3:51 am

Image meter: PNG file with background transparency

Get help with creating, editing & fixing problems with skins
emp00
Posts: 118
Joined: October 7th, 2022, 8:08 pm

Image meter: PNG file with background transparency

Post by emp00 »

I have an image meter displaying a png-file - this png has the background color (0,0,0) set as transparent. As an example see from wikimedia: a tree with transparent background.

I have tried both the ImageAlpha and ImageTint options but they act on "the tree" and keep the background in pure black. My goal is to make the "pure black" semi-transparent, so that the desktop background is visible with e.g. alpha 200. The tree however should be displayed without any transparency - only the background of the png should get some transparency.

How can I achieve this goal? Thanks for pulling me on the road to success, I'm surely overlooking an option but could not find it. Thanks for your help!
User avatar
KazukiGames82
Posts: 44
Joined: January 25th, 2023, 2:56 am

Re: Image meter: PNG file with background transparency

Post by KazukiGames82 »

Probably you messed up some option, beacuse using a simple meter without adding a lot of options works fine.

Code: Select all

[Tree]
Meter=Image
ImageName=tree.png
ImageTint=255,255,255
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22861
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Image meter: PNG file with background transparency

Post by jsmorley »

Code: Select all

[MeterTree]
Meter=Image
ImageName=C:\DN\Tree_Transparent_Background.png
SolidColor=0,0,0,100

https://docs.rainmeter.net/manual/meters/general-options/#SolidColor

2024-07-21_152203.png
You do not have the required permissions to view the files attached to this post.
emp00
Posts: 118
Joined: October 7th, 2022, 8:08 pm

Re: Image meter: PNG file with background transparency

Post by emp00 »

Thanks guys - I must have been drunk and blind at the same time, it worked all the time: ImageAlpha and ImageTint are not needed, using the transparent png in the image meter works out of the box. My mistake, thanks for looking at this!
User avatar
Yincognito
Rainmeter Sage
Posts: 8485
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Image meter: PNG file with background transparency

Post by Yincognito »

emp00 wrote: July 21st, 2024, 6:16 pm I have an image meter displaying a png-file - this png has the background color [...] set as transparent.
[...]
but they act on "the tree" and keep the background in pure black.
The replies from KazukiGames and jsmorley probably answered your question, but based on your description, how can a background be 'transparent' and 'pure black' at the same time, like alluded in your OP? Are you sure you don't have some black meter behind the image? :???:

EDIT:
emp00 wrote: July 21st, 2024, 7:46 pm Thanks guys - I must have been drunk and blind at the same time, it worked all the time: ImageAlpha and ImageTint are not needed, using the transparent png in the image meter works out of the box. My mistake, thanks for looking at this!
Yep, my point above exactly... don't worry, it sometimes happens to all of us, not seeing the forest for the trees (pun intended). :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
emp00
Posts: 118
Joined: October 7th, 2022, 8:08 pm

Re: Image meter: PNG file with background transparency

Post by emp00 »

Yincognito wrote: July 21st, 2024, 7:51 pm Are you sure you don't have some black meter behind the image? :???:
... and exactly this was my mistake. You got me.
User avatar
jsmorley
Developer
Posts: 22861
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Image meter: PNG file with background transparency

Post by jsmorley »

To be clear, nothing can act only on the "transparent" background of the .png image itself. What my suggestion was is to simply color the meter container itself, which you can do with any color and any opacity using SolidColor. Since the background of the tree is fully transparent, the meter container will "show through" and give you the effect you want.