Hello,
I have this image
I can use the -trim option to produce this result
I would like to achieve a more aggressive trim to produce a result like this
Remove all of the border color while leaving the maximum possible remaining pixels. Is there a way to do that? I realize that there would be many cases that would produce a 0x0 image, but that won't be an issue in my case.
Debian Linux
Version: ImageMagick 6.8.9-9 Q16 i586 2015-01-05
Thanks
How can I -trim an image more aggressively?
-
- Posts: 8
- Joined: 2016-02-23T14:17:23-07:00
- Authentication code: 1151
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How can I -trim an image more aggressively?
Fred has a bash script: http://www.fmwconcepts.com/imagemagick/ ... /index.php
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How can I -trim an image more aggressively?
Why not just make the white into transparent? Or the white and black to transparent, leaving just the green, then trim to get the bounds of the green. Or make the white into black and trim.
Try this (unix syntax)
Try this (unix syntax)
Code: Select all
convert t0NeV0C.png -fuzz 20% -fill black -opaque white -trim +repage result.png
-
- Posts: 8
- Joined: 2016-02-23T14:17:23-07:00
- Authentication code: 1151
Re: How can I -trim an image more aggressively?
snibgo wrote:Fred has a bash script: http://www.fmwconcepts.com/imagemagick/ ... /index.php
This works great. Thanks.