It is currently December 10th, 2018, 6:36 pm

[Suggestion] Merge image mask with shape meter

Report bugs with the Rainmeter application and suggest features.
User avatar
StArL0rd84
Posts: 271
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

[Suggestion] Merge image mask with shape meter

StArL0rd84 » November 10th, 2018, 8:52 pm

The shape meter is a very powerful tool which to draw almost anything with.
And imagine the shapes you could use to "cut" images with.

Thought of this today because in my use case, i need to round off the corners of the album art in my player.
Yes, i could just use an image and be done with it.

But, my suite is heavily built on shape meters which corner roundness can be adjusted with a slider.
Yes i could just make like 100 images to mask with.

But i would like to keep the skin size below 1TB ;P

Please consider looking into this.
Could be a powerful tool, and i am sure people could find even more interesting use cases for this feature.

mmmmm.png
You do not have the required permissions to view the files attached to this post.
User avatar
Active Colors
Moderator
Posts: 498
Joined: February 16th, 2012, 3:32 am

Re: [Suggestion] Merge image mask with shape meter

Active Colors » November 11th, 2018, 1:55 am

This is not exactly what you've requested but meanwhile you can use this technique.
Image Meter - Mask Image
Announcement thread
User avatar
jsmorley
Developer
Posts: 18445
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Suggestion] Merge image mask with shape meter

jsmorley » November 11th, 2018, 2:13 am

Stay tuned....
User avatar
Jeff
Posts: 23
Joined: September 3rd, 2018, 11:18 am

Re: [Suggestion] Merge image mask with shape meter

Jeff » November 11th, 2018, 3:13 pm

https://github.com/khanhas/MagickMeter#example-skins
https://github.com/khanhas/MagickMeter/wiki/Combine

In the meanwhile, use MagickMeter for that

Example Code:

Code: Select all

[MagickMeasure]
Measure          = Plugin
Plugin           = MagickMeter
Image            = [Cover] | Crop -100,-50,100,50,5 | Ignore 1
Image2           = Rectangle 0,0,200,200,10 | Ignore 1
Image3           = Combine Image | CopyAlpha Image2
DynamicVariables = 1

[MagickImage]
Meter       = Image
MeasureName = MagickMeasure
This would take the image of the cover, crops it (how it works is said on the wiki) (Ignore 1 is there so it doesn't appear), apply a mask (rectangle shape made by ImageMagick, not Rainmeter's D2D thing, the default settings are specifically the way they are for easy masking) and then combines both (CopyAlpha, probably not obvious at first glances, but what is white is what you can see and what is black is transparent, just like every image and video editing software ever)
Idk if the Aspect Ratio is correct since I'm 2lazy

I hope Morley's slaves are doing a good work on the D2D remake (and hope they add effects once they drop support for win 7)
User avatar
StArL0rd84
Posts: 271
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: [Suggestion] Merge image mask with shape meter

StArL0rd84 » November 11th, 2018, 4:40 pm

Jeff wrote:
November 11th, 2018, 3:13 pm
https://github.com/khanhas/MagickMeter#example-skins
https://github.com/khanhas/MagickMeter/wiki/Combine

In the meanwhile, use MagickMeter for that

Example Code:

Code: Select all

[MagickMeasure]
Measure          = Plugin
Plugin           = MagickMeter
Image            = [Cover] | Crop -100,-50,100,50,5 | Ignore 1
Image2           = Rectangle 0,0,200,200,10 | Ignore 1
Image3           = Combine Image | CopyAlpha Image2
DynamicVariables = 1

[MagickImage]
Meter       = Image
MeasureName = MagickMeasure
This would take the image of the cover, crops it (how it works is said on the wiki) (Ignore 1 is there so it doesn't appear), apply a mask (rectangle shape made by ImageMagick, not Rainmeter's D2D thing, the default settings are specifically the way they are for easy masking) and then combines both (CopyAlpha, probably not obvious at first glances, but what is white is what you can see and what is black is transparent, just like every image and video editing software ever)
Idk if the Aspect Ratio is correct since I'm 2lazy

I hope Morley's slaves are doing a good work on the D2D remake (and hope they add effects once they drop support for win 7)

Thank you for your suggestion, but although it looks awesome, the whole process seems a bit convoluted.
UPDATE: kinda Got it working after a reboot of my system.
But i am just getting a black square.
blksq.png

Code: Select all

[MagickMeasure]
Measure          = Plugin
Plugin           = MagickMeter
Image            = [mWnpThumbnail] | Crop 0,0,540,308,(#Roundness#+20) | Ignore 1
Image2           = Rectangle 0,0,540,308,(#Roundness#+20) | Ignore 1
Image3           = Combine Image | CopyAlpha Image2
DynamicVariables = 1
And roundness has to be exaggerated (#Roundness#+20)
You do not have the required permissions to view the files attached to this post.
Last edited by StArL0rd84 on November 11th, 2018, 6:04 pm, edited 3 times in total.
User avatar
StArL0rd84
Posts: 271
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: [Suggestion] Merge image mask with shape meter

StArL0rd84 » November 11th, 2018, 4:56 pm

jsmorley wrote:
November 11th, 2018, 2:13 am
Stay tuned....
Antennas adjusted,
Signal is strong....
User avatar
Jeff
Posts: 23
Joined: September 3rd, 2018, 11:18 am

Re: [Suggestion] Merge image mask with shape meter

Jeff » November 11th, 2018, 10:39 pm

Image

Code: Select all

[MagickMeasure]
Measure          = Plugin
Plugin           = MagickMeter
Image            = File [mWnpThumbnail] | RenderSize 540,540 | Crop -270,-135,540,308,5 | Ignore 1
Image2           = Rectangle 0,0,540,308,20 | Ignore 1
Image3           = Combine Image | CopyAlpha Image2
DynamicVariables = 1
i was on the toilet on the phone when i posted the first message, at least the theory part was right lol
explaining the thing part by part internally was a bad idea but idc
anyways lemme explain internally what RenderSzie does
it takes the image that is given to MagickMeter, rescales it internally for reference as a vector, then uses the default resize method and the rest is already above
User avatar
StArL0rd84
Posts: 271
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: [Suggestion] Merge image mask with shape meter

StArL0rd84 » November 12th, 2018, 6:06 pm

Jeff wrote:
November 11th, 2018, 10:39 pm
Image

Code: Select all

[MagickMeasure]
Measure          = Plugin
Plugin           = MagickMeter
Image            = File [mWnpThumbnail] | RenderSize 540,540 | Crop -270,-135,540,308,5 | Ignore 1
Image2           = Rectangle 0,0,540,308,20 | Ignore 1
Image3           = Combine Image | CopyAlpha Image2
DynamicVariables = 1
i was on the toilet on the phone when i posted the first message, at least the theory part was right lol
explaining the thing part by part internally was a bad idea but idc
anyways lemme explain internally what RenderSzie does
it takes the image that is given to MagickMeter, rescales it internally for reference as a vector, then uses the default resize method and the rest is already above
Thank you, that did the trick.
Works for now, but i am still hoping for native D2D? support within Rainmeter.
Don't want to ask the users of my skin to install too many programs.
Thank you for your help.
works.png
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 18445
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Suggestion] Merge image mask with shape meter

jsmorley » November 13th, 2018, 5:15 pm