It is currently November 15th, 2019, 11:38 am

Using ImageMask on album cover makes it lose quality

Report bugs with the Rainmeter application and suggest features.
jumi
Posts: 11
Joined: January 12th, 2018, 5:39 am

Using ImageMask on album cover makes it lose quality

jumi » March 4th, 2019, 4:48 am

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#
User avatar
jsmorley
Developer
Posts: 19710
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using ImageMask on album cover makes it lose quality

jsmorley » 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


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.
You do not have the required permissions to view the files attached to this post.
jumi
Posts: 11
Joined: January 12th, 2018, 5:39 am

Re: Using ImageMask on album cover makes it lose quality

jumi » March 4th, 2019, 5:21 am

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:
User avatar
jsmorley
Developer
Posts: 19710
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using ImageMask on album cover makes it lose quality

jsmorley » March 4th, 2019, 5:29 am

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.
User avatar
balala
Rainmeter Sage
Posts: 9053
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using ImageMask on album cover makes it lose quality

balala » March 4th, 2019, 4:35 pm

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.
User avatar
jsmorley
Developer
Posts: 19710
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using ImageMask on album cover makes it lose quality

jsmorley » March 4th, 2019, 5:37 pm

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.
User avatar
balala
Rainmeter Sage
Posts: 9053
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using ImageMask on album cover makes it lose quality

balala » March 4th, 2019, 5:49 pm

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: