Page 1 of 1

Using ImageMask on album cover makes it lose quality

Posted: March 4th, 2019, 4:48 am
by jumi
I'm using the image mask feature on the album cover meter to mask the cover into a rounded-rectangle shape. The only problem is that for some reason it actually makes the album art lose quality. Here are comparison pics.

Masked:
Image

Not masked:
Image

The album cover meter is resized to fit the original image mask size (a blank rounded-rectangle of 200px).

Relevant code:

Code: Select all

[Rainmeter]
Update=1000

[Variables]
AntiAlias=1
Player=CAD
Mask=Mask.png

[MeasureCover]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=COVER

[Cover]
Meter=Image
MeasureName=MeasureCover
H=200
W=200
MaskImageName=#@#Images\#Mask#

Re: Using ImageMask on album cover makes it lose quality

Posted: March 4th, 2019, 5:10 am
by jsmorley
I really, really, hate MaskImage....

I recommend that you get the latest 4.3 beta of Rainmeter, and do this instead:

Code: Select all

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

[Variables]

[MeterContainer]
Meter=Shape
Shape=Rectangle 0,0,200,200,12 | StrokeWidth 0

[MeterImage]
Meter=Image
ImageName=#CURRENTPATH#Test.jpg
X=-3
Y=-3
W=206
PreserveAspectRatio=1
Container=MeterContainer

https://docs.rainmeter.net/manual-beta/meters/general-options/container/


1.jpg


Note that I made the "content" image just a hair bigger than the "container", and used X and Y to center it in the mask. This is because if the content image is exactly the same dimensions as the container, some antialiasing that is done in the Shape when creating the corners can make the bottom right rounded corner look a little off. Making the content image a bit bigger gives it some area of the image to "work with" to help with antialiasing.

Re: Using ImageMask on album cover makes it lose quality

Posted: March 4th, 2019, 5:21 am
by jumi
jsmorley wrote: March 4th, 2019, 5:10 am I really, really, hate MaskImage....

I recommend that you get the latest 4.3 beta of Rainmeter, and do this instead:

Code: Select all

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

[Variables]

[MeterContainer]
Meter=Shape
Shape=Rectangle 0,0,200,200,12 | StrokeWidth 0

[MeterImage]
Meter=Image
ImageName=#CURRENTPATH#Test.jpg
X=-3
Y=-3
W=206
PreserveAspectRatio=1
Container=MeterContainer

https://docs.rainmeter.net/manual-beta/meters/general-options/container/




1.jpg
That's a wonderful solution and a reason to use the beta version, haha. Thanks for the help, jsmorley :thumbup:

Re: Using ImageMask on album cover makes it lose quality

Posted: March 4th, 2019, 5:29 am
by jsmorley
jumi wrote: March 4th, 2019, 5:21 am That's a wonderful solution and a reason to use the beta version, haha. Thanks for the help, jsmorley :thumbup:
Glad to help. Feel free to use your image with the rounded corners as the container, if you prefer it to the Shape meter.

Re: Using ImageMask on album cover makes it lose quality

Posted: March 4th, 2019, 4:35 pm
by balala
jsmorley wrote: March 4th, 2019, 5:10 am I really, really, hate MaskImage....
I'm not surprised. However MaskImage had (has?) its own importance at its own time, but since we have the Container, ImageMask lost it. However it was a powerful and useful option at its own moment, I think.

Re: Using ImageMask on album cover makes it lose quality

Posted: March 4th, 2019, 5:37 pm
by jsmorley
balala wrote: March 4th, 2019, 4:35 pm I'm not surprised. However MaskImage had (has?) its own importance at its own time, but since we have the Container, ImageMask lost it. However it was a powerful and useful option at its own moment, I think.
Sure. I really never liked it, due to the limitations with positioning the content in the mask, but it had its uses for sure. I think Container, with far more power and flexibility, should always be used in favor of it going forward, but MaskImage isn't going anywhere.

Re: Using ImageMask on album cover makes it lose quality

Posted: March 4th, 2019, 5:49 pm
by balala
jsmorley wrote: March 4th, 2019, 5:37 pm I think Container, with far more power and flexibility, should always be used in favor of it going forward
For sure. I agree... :thumbup:
jsmorley wrote: March 4th, 2019, 5:37 pm but MaskImage isn't going anywhere.
Yep. The good old backward compatibility. :great: