Last active
August 16, 2024 01:33
-
-
Save juliendargelos/d9a08e693dfcdab80d28dd609b717536 to your computer and use it in GitHub Desktop.
Imagemagick command that trims transparent pixels from an image.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert input.png -trim +repage output.png |
You can do this much simpler with:
mogrify *.png -trim +repage
@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
Pretty leet, especially mogrify
👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!
Here's how to loop that over all images in a folder in case anyone stumbles upon it: