Page 1 of 1
					
				crop empty space around images
				Posted: 2010-02-27T13:00:32-07:00
				by tester
				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
			 
			
					
				Re: crop empty space around images
				Posted: 2010-02-27T13:59:49-07:00
				by Bonzo
				
			 
			
					
				Re: crop empty space around images
				Posted: 2010-02-27T14:19:33-07:00
				by fmw42
				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 
			 
			
					
				Re: crop empty space around images
				Posted: 2016-12-07T19:44:49-07:00
				by jauson
				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