Page 1 of 1

[CL] Removing background-color replacing it with transparent

Posted: 2011-04-20T09:34:02-07:00
by gialloporpora
Dear all,
it is the first time I ask in this new pretty forum :-), first I have asked my question on mailing list.

I have this question.

The start point is this image:

Image

and other two images like this with contains the minimize and close button.
My goal is to obtains an image with the buttons but with transparent background.

Now my result is this image:

Image


I have successfully used ImageMagick to perform 3 of the steps to obtain the image:

Code: Select all

convert min.png -crop 26x19+0+19 +repage b1.png

Code: Select all

convert b1.png -crop  19x19+4+0  +repage b2.png
At this point I have used Paint.net to remove the background replacing it with transparent background, at the end I have put all together with IM:

Code: Select all

convert b1.png  c2.png b3.png +append  final.png

Is it possible to perform the step for removing background also with IM?

Thanks
Sandro

Re: [CL] Removing background-color replacing it with transpa

Posted: 2011-04-20T09:56:29-07:00
by fmw42
try this and vary the fuzz XX% as needed


convert buttonmaxi.png -fuzz 30% -transparent "rgba(0,0,0,255)" buttonmaxi_f30trans.png

Re: [CL] Removing background-color replacing it with transpa

Posted: 2011-04-20T13:59:01-07:00
by gialloporpora
Oh, very nice :-D it works like a charm, thanks, I think this will very helpful to me in future :-)

Re: [CL] Removing background-color replacing it with transpa

Posted: 2011-04-20T14:41:53-07:00
by fmw42
gialloporpora wrote:Oh, very nice :-D it works like a charm, thanks, I think this will very helpful to me in future :-)
For relatively new users, good reading at:

http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/script/comma ... ptions.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/