It is currently October 5th, 2024, 2:46 pm
Mask Image
-
- Moderator
- Posts: 1318
- Joined: February 16th, 2012, 3:32 am
- Location: Berlin, Germany
-
- Developer
- Posts: 22819
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Image Masking
Code: Select all
[Rainmeter]
Update=75
DynamicWindowSize=1
AccurateText=1
[MeasureAnim]
Measure=Calc
Formula=(MeasureAnim % 16) + 1
[MeterAnim]
Meter=Image
W=200
ImagePath=#@#Images\
MeasureName=MeasureAnim
MaskImagePath=#@#Masks\
MaskImageName=Circle.png
You do not have the required permissions to view the files attached to this post.
-
- Posts: 407
- Joined: September 20th, 2012, 3:17 pm
- Location: USA - Montana
Re: Image Masking
With great power comes great responsibility.
01010100 01100101 01100011 01101000 01101110 01101111 01101100 01101111 01100111 01101001
01100011 01100001 01101100 00100000 01000010 01100001 01100100 01100001 01110011 01110011
01100011 01100001 01101100 00100000 01000010 01100001 01100100 01100001 01110011 01110011
-
- Developer
- Posts: 22819
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Image Masking
It should be noted that the ImageName is masked onto any "non-transparent" areas of MaskImageName. However, any partial transparency of the either image is preserved in the final result. This can be used to create some nice effects, where you have some partially transparent areas of the mask, and the resulting image will have the same transparency.
In effect what is going on is that the ImageName is masked onto the MaskImageName, replacing pixel for pixel MaskImageName with ImageName. If a pixel in the either the mask or the image has an alpha channel that is not 100%, the resulting masked image will use that alpha channel. That is what results in it being a "shape" when the mask has fully transparent areas, but it can be used to have partially transparent areas as well.
If either the primary image or the mask image has areas of transparency or partial transparency, those "alpha channel" values are applied to the final image. When both images have a shared area with full or partial transparency, the "most transparent" value is applied.
For example, using a solid to transparent gradient:
In this case, we are using the "mask" to create a transition from solid to transparent, rather than using the mask to define a "shape". The two can be combined of course, to get some nice effects.
In effect what is going on is that the ImageName is masked onto the MaskImageName, replacing pixel for pixel MaskImageName with ImageName. If a pixel in the either the mask or the image has an alpha channel that is not 100%, the resulting masked image will use that alpha channel. That is what results in it being a "shape" when the mask has fully transparent areas, but it can be used to have partially transparent areas as well.
If either the primary image or the mask image has areas of transparency or partial transparency, those "alpha channel" values are applied to the final image. When both images have a shared area with full or partial transparency, the "most transparent" value is applied.
For example, using a solid to transparent gradient:
In this case, we are using the "mask" to create a transition from solid to transparent, rather than using the mask to define a "shape". The two can be combined of course, to get some nice effects.
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 22819
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Image Masking
It should also be noted that while MaskImageName does not support being bound to a measure with something like:
[MeterOne]
Meter=Image
MeasureName=SomeMeasure
MeasureName2=SomeOtherMeasure
MaskImageName=%2.png
You can still have MaskImageName use the value of a measure in a dynamic way with [SectionVariables], (or even #Variables#) like:
[MeterOne]
Meter=Image
MeasureName=SomeMeasure
MaskImageName=[SomeOtherMeasure].png
DynamicVariables=1
[MeterOne]
Meter=Image
MeasureName=SomeMeasure
MeasureName2=SomeOtherMeasure
MaskImageName=%2.png
You can still have MaskImageName use the value of a measure in a dynamic way with [SectionVariables], (or even #Variables#) like:
[MeterOne]
Meter=Image
MeasureName=SomeMeasure
MaskImageName=[SomeOtherMeasure].png
DynamicVariables=1
-
- Posts: 117
- Joined: June 20th, 2012, 12:44 am
Re: Image Masking
Huzzah! Very exciting news. Fantastic work, Rainmeter Team! I look forward to testing this out.
Question: since ScaleMargins is not available, and the scaling is fixed based on W/H, is there a way to use this new feature, or plans for additional development, to produced rounded rectangles of the same proportions as the source image? An image mask would have a fixed size and aspect ratio.
I came up with a novel approach to image masking including dynamic rounded corners, but it has obvious shortcomings.
http://rainmeter.net/forum/viewtopic.php?p=101911#p101911
I'd love to see something like this integrated into the image mask tool in a future update.
Question: since ScaleMargins is not available, and the scaling is fixed based on W/H, is there a way to use this new feature, or plans for additional development, to produced rounded rectangles of the same proportions as the source image? An image mask would have a fixed size and aspect ratio.
I came up with a novel approach to image masking including dynamic rounded corners, but it has obvious shortcomings.
http://rainmeter.net/forum/viewtopic.php?p=101911#p101911
I'd love to see something like this integrated into the image mask tool in a future update.
-
- Developer
- Posts: 22819
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Image Masking
Not in the short term. The size of the mask, and thus the meter, is defined by the W an H set on the meter. The size of the resulting image is entirely driven by that, sizing and cropping the primary image to "fill" the meter. There really is no possible way to have the reverse, the mask image be in any way driven by the primary image. That is a dog chasing its own tail.iNjUST wrote:Huzzah! Very exciting news. Fantastic work, Rainmeter Team! I look forward to testing this out.
Question: since ScaleMargins is not available, and the scaling is fixed based on W/H, is there a way to use this new feature, or plans for additional development, to produced rounded rectangles of the same proportions as the source image? An image mask would have a fixed size and aspect ratio.
I came up with a novel approach to image masking including dynamic rounded corners, but it has obvious shortcomings.
http://rainmeter.net/forum/viewtopic.php?p=101911#p101911
I'd love to see something like this integrated into the image mask tool in a future update.
You certainly can create a rectangular "shape" as a mask image that is some defined size and has rounded corners, that is sorta the entire point of this. However, you can't effect the "aspect" of the corners independent of the rest of the mask image, that would require some kind of MaskScaleMargins which might be possible in a future version, but no promises, and you can't have that mask image be sized in response to the size of the primary image. The primary image will just "fill" the mask image, with the size exactly the same size as the meter created by the mask image.
-
- Posts: 269
- Joined: January 9th, 2013, 7:52 pm
- Location: Clemson University
-
- Developer
- Posts: 22819
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Image Masking
Code: Select all
MeasureName=WebParserIconMeasure
MaskImageName=Weather.png
You do not have the required permissions to view the files attached to this post.
-
- Posts: 20
- Joined: May 31st, 2011, 7:15 am
Re: Image Masking
Cool things will come from this
heres something i did from jsmorley's files...
https://www.dropbox.com/s/fnxue8tuvqpulzi/TVDance_.rmskin
heres something i did from jsmorley's files...
https://www.dropbox.com/s/fnxue8tuvqpulzi/TVDance_.rmskin