Hi,
Is there a way to -crop "automatically" the white border or empty space around the images like e.g. with gimp?
Please let me know how to solve this because I miss the option at the crop manual page :-/
Thanks a lot
crop empty space around images
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: crop empty space around images
also see -fuzz to allow your trim to be less sensitive to slight color variations in the area you want to trim.
see http://www.imagemagick.org/script/comma ... s.php#fuzz
for example,
convert image -fuzz 1% -trim +repage result
The +repage removes the virtual canvas which is the size of the input and makes the output just the trimmed size.
see http://www.imagemagick.org/Usage/crop/#trim
see http://www.imagemagick.org/script/comma ... s.php#fuzz
for example,
convert image -fuzz 1% -trim +repage result
The +repage removes the virtual canvas which is the size of the input and makes the output just the trimmed size.
see http://www.imagemagick.org/Usage/crop/#trim
Re: crop empty space around images
I had an issue with a png having a slight bit of transparency, which resulted in removing the transparency part, and leaving the white areas. To fix it, first I had to flatten, then trim.
Code: Select all
convert partial-trans.png -flatten -fuzz 1% -trim +repage trimmed.jpg