Page 1 of 1

when i use connected component for remove not remove and convert to alpha ?

Posted: 2018-09-05T12:06:17-07:00
by diegomage
Im trying to remove component and the remove component replace by alpha color
but when I remove this image the balls instead of remove appears in black colors

HOw I could corret my command

Code: Select all

  convert image.png   -define connected-components:area-threshold=2 -define connected-components:mean-color=true -connected-components 4 output .gif
this is my image

Image
this is my output
Image

please help me

Re: when i use connected component for remove not remove and convert to alpha ?

Posted: 2018-09-05T13:04:37-07:00
by fmw42
I do not think connected components works on an image with an alpha channel. Either process the alpha channel or process the underlying image or flatten the alpha channel onto some background color and then process that.

What exactly do you want to remove? It is not clear what you want to do.


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

Re: when i use connected component for remove not remove and convert to alpha ?

Posted: 2018-09-05T13:09:44-07:00
by diegomage
remove but that not appears the black circles

Re: when i use connected component for remove not remove and convert to alpha ?

Posted: 2018-09-05T13:14:21-07:00
by fmw42
Sorry I still do not understand. Perhaps you can make a diagram of what you want removed by drawing on your picture and pointing to the areas to be removed.

Also please, provide your IM version and platform when asking questions, since syntax may differ.

Re: when i use connected component for remove not remove and convert to alpha ?

Posted: 2018-09-05T13:48:16-07:00
by diegomage
I solved this removing alpha first with this code

Code: Select all

convert image.png  -alpha remove -alpha off  minif

Code: Select all

  convert minif -define connected-components:area-threshold=2 -define connected-components:mean-color=true -connected-components 4 outputx.gif

Code: Select all

convert outputx.gif   -transparent white  outputx2.gif

Re: when i use connected component for remove not remove and convert to alpha ?

Posted: 2018-09-05T13:49:31-07:00
by diegomage
Image