Page 1 of 1
how I could remove a circle of this image using connected components remove?
Posted: 2018-06-12T07:20:17-07:00
by diegomage
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
Re: how I could remove a circle of this image using connected components remove?
Posted: 2018-06-12T09:58:02-07:00
by fmw42
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
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.
Re: how I could remove a circle of this image using connected components remove?
Posted: 2018-06-12T10:24:11-07:00
by diegomage
hi not work for me , i cant remove the circle
Re: how I could remove a circle of this image using connected components remove?
Posted: 2018-06-12T10:39:45-07:00
by fmw42
What is your Imagemagick versions and platform? You need IM 6.8.9.10 or higher for connected components.
Re: how I could remove a circle of this image using connected components remove?
Posted: 2018-06-12T10:43:23-07:00
by diegomage
Version: ImageMagick 7.0.7-8 Q16 x86_64 2017-10-28
http://www.imagemagick.org
os:ubuntu 14.04
Re: how I could remove a circle of this image using connected components remove?
Posted: 2018-06-12T10:49:12-07:00
by diegomage
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
Re: how I could remove a circle of this image using connected components remove?
Posted: 2018-06-12T10:49:29-07:00
by diegomage
not work this command
Re: how I could remove a circle of this image using connected components remove?
Posted: 2018-06-12T10:53:56-07:00
by fmw42
It seems to be a bug in ImageMagick 7. I will report it. Note that IM 7 use magick in place of convert.
Re: how I could remove a circle of this image using connected components remove?
Posted: 2018-06-12T10:57:48-07:00
by diegomage
not work with magick , I will try to update and test with 7.1 version
Re: how I could remove a circle of this image using connected components remove?
Posted: 2018-06-12T10:59:49-07:00
by fmw42
It is a bug in IM 7
I have reported it on the Bugs forum.
Re: how I could remove a circle of this image using connected components remove?
Posted: 2018-06-12T11:14:50-07:00
by diegomage
ok very thankyou