Hi All
Is there a way to remove the white/anycolor border that contains a logo with -trim?
or alternatively,
can I detect the dimensions of a Photo and create a mask to cover the border/logo?
I am new to image magick so please be gentle if this has already been covered, I did search.
Thank you all so much.
Mark
Can I remove border that contains an image
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Can I remove border that contains an image
We will need more information. Please always provide your IM version and platform, since syntax may differ. Also provide an example of your problem via posting image(s) to some free hosting service such as dropbox.com and put the URL here.
Please also read the top post in this forum. See IMPORTANT: Please Read This FIRST Before Posting at viewtopic.php?f=1&t=31228
Please also read the top post in this forum. See IMPORTANT: Please Read This FIRST Before Posting at viewtopic.php?f=1&t=31228
Re: Can I remove border that contains an image
I am using the latest OSX 10.10.5 with the latest IM from Homebrew but the code it will run on Linux.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Can I remove border that contains an image
It is easy to remove that top using -fuzz XX% -trim +repage. But the bottom is harder because of the text. Since the text is light gray, this seems to work with a large fuzz %. The fuzz percent allow the trim to consider colors that vary from constant by that percent.
Otherwise, one would need to crop the left column of the image and use txt: output format to the terminal to see where the first and last transition from white to other than white occurred, then you could compute the crop coordinates and use -crop or -shave to remove the top and bottom.
See
http://www.imagemagick.org/Usage/crop/#trim
http://www.imagemagick.org/Usage/crop/#crop
http://www.imagemagick.org/Usage/crop/#shave
http://www.imagemagick.org/Usage/crop/#chop
http://www.imagemagick.org/Usage/files/#txt
For newbies, see
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
http://www.imagemagick.org/script/comma ... essing.php
Code: Select all
convert image_full.jpg -fuzz 70% -trim +repage result.jpg
See
http://www.imagemagick.org/Usage/crop/#trim
http://www.imagemagick.org/Usage/crop/#crop
http://www.imagemagick.org/Usage/crop/#shave
http://www.imagemagick.org/Usage/crop/#chop
http://www.imagemagick.org/Usage/files/#txt
For newbies, see
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
http://www.imagemagick.org/script/comma ... essing.php