It is currently September 29th, 2024, 7:24 am

PNG or SolidColor?

General topics related to Rainmeter.
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

PNG or SolidColor?

Post by rbriddickk84 »

I was wondering about this for performance reasons.
Which would be less resource eater:
-If i make a 100x100 pixel, black image and 50% transparent, and use this as PNG image in a Meter

or

-If i make an Image Meter with 100x100 pixel dimensions and set the SolidColor=0,0,0,127
?

Thank you!
User avatar
jsmorley
Developer
Posts: 22783
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: PNG or SolidColor?

Post by jsmorley »

rbriddickk84 wrote:I was wondering about this for performance reasons.
Which would be less resource eater:
-If i make a 100x100 pixel, black image and 50% transparent, and use this as PNG image in a Meter

or

-If i make an Image Meter with 100x100 pixel dimensions and set the SolidColor=0,0,0,127
?

Thank you!
The difference will be trivial really, but creating it with the Image meter and SolidColor is a hair more efficient than hitting the hard drive to load an image file when the skin is loaded or refreshed.

Rainmeter will "cache" the image, so assuming the image doesn't change in the background, the difference will just be a single hit to the hard drive to read and load the image file when the skin is first loaded or when refreshed. After it is loaded and cached, the difference between the two is so small as to round to zero.

On balance however if I COULD create the shape I wanted with an Image meter and SolidColor, I would.
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: PNG or SolidColor?

Post by rbriddickk84 »

I see, my guesses were basically right :)
Mostly i do all basic shapes (rectangles) with simple colors with SolidColor, but i wasn't sure about it if it's better or not to be more efficient or not. Thought maybe if i use an image, it reservers more memory then drawing it out with SolidColor in an Image Meter. Altho i don't know the GPU and rendering usage difference, but probably it's not that big difference between single colored rectangles. :)
You see i love minimal styles, i am working on one right now, it will be a bigger project, and i drawing almost everything out with Image Meter and SolidColor. Also a pretty large area: 600x800 pixel window, which size and opacity controlled trough ActionTimer. But it has one corner which is a rectangular triangle, so for that part i must create it with a PNG.

Thank you very much for the enlightment :D :thumbup: