Apply filter through mask?
Posted: 2009-04-05T16:06:10-07:00
Hello,
Newbie IM user seeks simplified way to apply an effect filter to an image through a mask. For example I would like to apply gaussian blur selectively to an image using another grayscale image (which is a gradient) as the mask.
So far, I've tried to blur the image, then merged it on top of the unblurred version, using the mask image to block opacity. The result that I get is just OK, but not quite what I"m looking for. As you can see from the IM result (second image below), too much of the underlying sharp image comes through, and it has the effect of an "outer glow" in the transition area, rather than the smooth transition from sharp to blurry.
Below is the desired result that I'm trying to achieve (I made this in PS by using equivalent amount of blur and applying to the image through a selection:
Here is what I tried so far in IM:
convert sharp.jpg blurred.jpg blurmask.jpg -composite result.jpg
And I got this:
These are the images used in the above IM command:
sharp.jpg
blurred.jpg
blurmask.jpg
I did find a link to this script when researching this:
http://www.fmwconcepts.com/imagemagick/ ... /index.php
This script may provide a solution, but was wondering if anyone could think of an even simpler solution using the available operators in IM. Any suggestions very much appreciated.
Thanks,
K
Newbie IM user seeks simplified way to apply an effect filter to an image through a mask. For example I would like to apply gaussian blur selectively to an image using another grayscale image (which is a gradient) as the mask.
So far, I've tried to blur the image, then merged it on top of the unblurred version, using the mask image to block opacity. The result that I get is just OK, but not quite what I"m looking for. As you can see from the IM result (second image below), too much of the underlying sharp image comes through, and it has the effect of an "outer glow" in the transition area, rather than the smooth transition from sharp to blurry.
Below is the desired result that I'm trying to achieve (I made this in PS by using equivalent amount of blur and applying to the image through a selection:
Here is what I tried so far in IM:
convert sharp.jpg blurred.jpg blurmask.jpg -composite result.jpg
And I got this:
These are the images used in the above IM command:
sharp.jpg
blurred.jpg
blurmask.jpg
I did find a link to this script when researching this:
http://www.fmwconcepts.com/imagemagick/ ... /index.php
This script may provide a solution, but was wondering if anyone could think of an even simpler solution using the available operators in IM. Any suggestions very much appreciated.
Thanks,
K