Last Updated: February 25, 2016
·
963
· rane

Use ImageMagick to trim empty around an image

The area around the image can also be white instead of transparent like below.

Usage

convert before.png -fuzz "1%" -trim +repage after.png

Example

Picture Picture

As bash/zsh function

function convert-trim; {
  convert "$1" -fuzz "1%" -trim +repage "$1"
}

$ convert-trim image.png