Last active
July 1, 2024 15:42
-
-
Save spvkgn/494b5b3eab0b9182b909b6a1fb7a4d4c to your computer and use it in GitHub Desktop.
imagemagick tips
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
#!/bin/sh | |
# resize | |
mogrify -format jpg -strip -interlace plane -sampling-factor 4:2:0 -define jpeg:dct-method=float -density 300x300 -resize 50% -quality 85 -path /tmp *.jpg | |
convert -format jpg -strip -interlace plane -sampling-factor 4:2:0 -define jpeg:dct-method=float -density 300x300 -resize 50% -quality 85 file.jpg | |
# crop | |
magick mogrify -crop 1280x360+0+360 +repage *.png | |
# trim black background https://imagemagick.org/discourse-server/viewtopic.php?f=4&t=35579 | |
magick mogrify -fuzz 5% -define trim:percent-background=50% -trim *.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment