get rid of transparency of selected part of png using imagemagic

Posted on

QUESTION :

I have this png image with transparency http://s18.postimg.org/d2h2m4yl5/flatten_canvas2.png

I want to get rid of transparency using imagemagick, but only of the selected part and not the whole image.

Is it possible?

ANSWER :

What I would suggest you to do is to cut down the portion which I don’t want to be transparent and then use :

 convert image.png -transparent white result.png

or if not perfectly white, then try

 convert image.png -fuzz XX% -transparent white result.png

where the smaller the %, the closer to true white or conversely, the larger the %, the more variation from white is allowed to become transparent.
For more details check this and this.
After applying them I would superimpose that image on the original one. However you can use Geometry if you want to . But I would prefer the first way only.

Leave a Reply

Your email address will not be published.