Skip to content

Instantly share code, notes, and snippets.

@juliendargelos
Last active August 16, 2024 01:33
Show Gist options
  • Save juliendargelos/d9a08e693dfcdab80d28dd609b717536 to your computer and use it in GitHub Desktop.
Save juliendargelos/d9a08e693dfcdab80d28dd609b717536 to your computer and use it in GitHub Desktop.
Imagemagick command that trims transparent pixels from an image.
convert input.png -trim +repage output.png
@a-kriya
Copy link

a-kriya commented Jul 13, 2022

@enijar I had to put .png at the end to get it to work (on a Mac). Imagemagick is sensitive to order of params.

mogrify -trim +repage *.png

@j4hangir
Copy link

Pretty leet, especially mogrify 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment