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

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?".
Post Reply
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

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

Post by diegomage »

remove but that not appears the black circles
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

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

Post 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
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

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

Post by diegomage »

Image
Post Reply