Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Cmars
Posts: 8 Joined: 2010-10-29T12:03:56-07:00
Authentication code: 8675308
Contact:
Post
by Cmars » 2010-10-29T12:12:35-07:00
Well I'm trying to make the image's edges soften so they don't look sharp (transparent background), and I can't seem to get it to work:
Code: Select all
convert "C:\imgs\a.png" -antialias "C:\imgs\a.png"
So yea, I need some help here :/
And yes, I've been searching/tried things for 7 days, but nothing works :/ <.<
Last edited by
Cmars on 2010-10-30T04:47:30-07:00, edited 3 times in total.
Cmars
Posts: 8 Joined: 2010-10-29T12:03:56-07:00
Authentication code: 8675308
Contact:
Post
by Cmars » 2010-10-29T12:38:16-07:00
Ok, I can't find anything <.<
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Contact:
Post
by fmw42 » 2010-10-29T13:16:43-07:00
Cmars wrote: Well I'm trying to make the image's edges soften so they don't look sharp (transparent background), and I can't seem to get it to work:
Code: Select all
convert "C:\imgs\a.png" -antialias "C:\imgs\a.png"
So yea, I need some help here :/
And yes, I've been searching/tried things for 7 days, but nothing works :/ <.<
-antialias is a setting used with some operator such as -draw. by itself it does nothing.
I think you need to post a link to your example(s) and explain in more detail what is the issue or what you desire for the result.
Cmars
Posts: 8 Joined: 2010-10-29T12:03:56-07:00
Authentication code: 8675308
Contact:
Post
by Cmars » 2010-10-29T13:29:27-07:00
Other example:
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Contact:
Post
by fmw42 » 2010-10-29T16:20:22-07:00
you need to take the mask and make it binary. then blur the mask a little with a linear ramp blur, then make the ramp taper to cut out the outside part of the blur.
Here are two ways to do that. You can adjust the -blur 1x65000 (change the 1 to 0.5 or 2 or whatever) as desired.
convert Sir_amik_varze_detail.PNG \
\( -clone 0 -alpha off \) \
\( -clone 0 -alpha extract -blur 1x65000 -level 50x100% \) \
-delete 0 -compose copy_opacity -composite Sir_amik_varze_detail1.png
convert Sir_amik_varze_detail.PNG -channel A -blur 1x65000 -level 50x100% \
-channel rgba Sir_amik_varze_detail1b.png
Cmars
Posts: 8 Joined: 2010-10-29T12:03:56-07:00
Authentication code: 8675308
Contact:
Post
by Cmars » 2010-10-29T17:32:25-07:00
fmw42 wrote: you need to take the mask and make it binary. then blur the mask a little with a linear ramp blur, then make the ramp taper to cut out the outside part of the blur.
Here are two ways to do that. You can adjust the -blur 1x65000 (change the 1 to 0.5 or 2 or whatever) as desired.
convert Sir_amik_varze_detail.PNG \
\( -clone 0 -alpha off \) \
\( -clone 0 -alpha extract -blur 1x65000 -level 50x100% \) \
-delete 0 -compose copy_opacity -composite Sir_amik_varze_detail1.png
convert Sir_amik_varze_detail.PNG -channel A -blur 1x65000 -level 50x100% \
-channel rgba Sir_amik_varze_detail1b.png
Thank you.
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Contact:
Post
by fmw42 » 2010-10-29T18:02:04-07:00
if the edges pull in too much, beside making the 1 smaller, you can instead try to adjust the 50x100% (say make the 50 to 45 or 40).
Also see
http://www.imagemagick.org/Usage/channels/#mask_diff
Cmars
Posts: 8 Joined: 2010-10-29T12:03:56-07:00
Authentication code: 8675308
Contact:
Post
by Cmars » 2010-10-30T04:47:06-07:00
Thanks for all help
anthony
Posts: 8883 Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia
Contact:
Post
by anthony » 2010-10-31T19:27:56-07:00
You could try using a feathering blur, of the alpha channel combined with the original channel to ensure fully-transparent pixels don't become partially transparent
http://www.imagemagick.org/Usage/blur/#feathering
Users browsing this forum: Amazon [Bot] , Bing [Bot] , Google [Bot] and 30 guests