how I could remove a circle of this image using connected components remove?

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

how I could remove a circle of this image using connected components remove?

Post by diegomage » 2018-06-12T07:20:17-07:00

Image



You may want to remove certain objects by making them transparent. Use -define connected-components:remove=list-of-ids (e.g. -define connected-components:remove=2,4-5).


using a command like this

Code: Select all

convert image  -define connected-components:remove=2,4-5 outimage
please help me

User avatar
fmw42
Posts: 23248
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how I could remove a circle of this image using connected components remove?

Post by fmw42 » 2018-06-12T09:58:02-07:00

Try this (Unix syntax)

Code: Select all

convert image.jpg -auto-level -threshold 50% -type bilevel \
-define connected-components:remove=2,4-5 \
-define connected-components:mean-color=true \
-connected-components 4 \
result.png
Image

For Windows replace \ with ^

Note, the -auto-level -threshold 50% -type bilevel is needed to make it only two colors. JPG is compressed and does not maintain constant colors well.

diegomage
Posts: 178
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

Re: how I could remove a circle of this image using connected components remove?

Post by diegomage » 2018-06-12T10:24:11-07:00

hi not work for me , i cant remove the circle

User avatar
fmw42
Posts: 23248
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how I could remove a circle of this image using connected components remove?

Post by fmw42 » 2018-06-12T10:39:45-07:00

What is your Imagemagick versions and platform? You need IM 6.8.9.10 or higher for connected components.

diegomage
Posts: 178
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

Re: how I could remove a circle of this image using connected components remove?

Post by diegomage » 2018-06-12T10:43:23-07:00

Version: ImageMagick 7.0.7-8 Q16 x86_64 2017-10-28 http://www.imagemagick.org

os:ubuntu 14.04

diegomage
Posts: 178
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

Re: how I could remove a circle of this image using connected components remove?

Post by diegomage » 2018-06-12T10:49:12-07:00

Code: Select all

convert bwlabel_part1_01.jpg -auto-level -threshold 50% -type bilevel -define connected-components:remove=2,4-5 -define connected-components:mean-color=true -connected-components 4 zfgresult.png

diegomage
Posts: 178
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

Re: how I could remove a circle of this image using connected components remove?

Post by diegomage » 2018-06-12T10:49:29-07:00

not work this command

User avatar
fmw42
Posts: 23248
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how I could remove a circle of this image using connected components remove?

Post by fmw42 » 2018-06-12T10:53:56-07:00

It seems to be a bug in ImageMagick 7. I will report it. Note that IM 7 use magick in place of convert.

diegomage
Posts: 178
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

Re: how I could remove a circle of this image using connected components remove?

Post by diegomage » 2018-06-12T10:57:48-07:00

not work with magick , I will try to update and test with 7.1 version

User avatar
fmw42
Posts: 23248
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how I could remove a circle of this image using connected components remove?

Post by fmw42 » 2018-06-12T10:59:49-07:00

It is a bug in IM 7

I have reported it on the Bugs forum.

diegomage
Posts: 178
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

Re: how I could remove a circle of this image using connected components remove?

Post by diegomage » 2018-06-12T11:14:50-07:00

ok very thankyou

Post Reply