Hello Team,
I need to apply feather effect on any of the transparent image which are having different corners and I want to apply the 20px feather for the input image, same as we are applying on photoshop.
Please let me know your valuable inputs which are available in image magick or imagick library.
I have added one below input file for sample which I am using for testing purpose.
Need Help on Feather effect
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need Help on Feather effect
Try this Imagemagick command line. Adjust the blur level as desired. Sorry I do not know Imagick equivalents.
______________________
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
Code: Select all
convert 5ba0fadb35c3b.png -channel a -blur 0x7 -level 50x100% +channel result.png
______________________
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
Re: Need Help on Feather effect
Thank you Fred, your provided code is working as expected, only I need to know where exactly I need to put the value 25 for the 25px feather radius in your below provided script, It is at "-level 25x100%" or "-blur 0x25" for setting the 25px feather effect same as in photoshop?
convert 5ba0fadb35c3b.png -channel a -blur 0x7 -level 50x100% +channel result.png
convert 5ba0fadb35c3b.png -channel a -blur 0x7 -level 50x100% +channel result.png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need Help on Feather effect
It would be in the blur. But Imagemagick does not use the same blur arguments as photoshop. So you will need adjustment the blur value where I have 7 to something that matches what you get from photoshop. My guess was 7 but 8 might be better. Since 8x3=24 is close to 25.
Alternately, try this variation.
Here I specified a 25 pixel linear blur rather than the 7 or 8 pixel gaussian blur sigma. So if 25 does not work adjust the 25 value from 25x65000 argument. Do not change 65000.
Alternately, try this variation.
Code: Select all
convert 5ba0fadb35c3b.png -channel a -blur 25x65000 -level 50x100% +channel result.png
Re: Need Help on Feather effect
Hello Team,
Can anyone please help me for applying the feathering differently from the horizontal and vertically for an image.
I am using below command but unfortunately it is taking long time to apply the feathering on result image.
Below is the input image URL.
https://www.dropbox.com/s/pldzxwx1ss37o ... M.png?dl=0
Please provide any solution so that I can apply feathering as quick as possible, right now for this mentioned image the script taking around 40 seconds.
Thanks in advanced.
Can anyone please help me for applying the feathering differently from the horizontal and vertically for an image.
I am using below command but unfortunately it is taking long time to apply the feathering on result image.
Code: Select all
exec("convert checkFeather-TRIM.png \( +clone -alpha extract -threshold 0% +duplicate -compose blur -define compose:args='11x21' -composite -level 50x100% \) -alpha off -compose CopyOpacity -composite result112.png");
https://www.dropbox.com/s/pldzxwx1ss37o ... M.png?dl=0
Please provide any solution so that I can apply feathering as quick as possible, right now for this mentioned image the script taking around 40 seconds.
Thanks in advanced.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Need Help on Feather effect
You are using "-compose blur", which gives a variable size blur, where the size is according to the mask (which in your case is a duplicate of the extracted alpha). As almost all pixels have alpha either 0 or 100%, the variable effect is wasted. Do you really want a variable blur? If not, a simple "-blur 0x10" or whatever is far quicker.
Even quicker, you don't need to extract alpha and finally copy-opacity. Simply apply the blur to just the alpha channel:
Even quicker, you don't need to extract alpha and finally copy-opacity. Simply apply the blur to just the alpha channel:
Code: Select all
convert checkFeather-TRIM.png -channel A -blur 0x10 +channel out.png
snibgo's IM pages: im.snibgo.com