Last active
March 15, 2018 19:19
-
-
Save benjaminblack/4953a8f43e71d0e61a0e9287e928ac28 to your computer and use it in GitHub Desktop.
ImageMagick cheat sheet
This file contains hidden or 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 a directory of PNGs to JPEGs: | |
```bash | |
for file in `ls *.png` | |
do | |
extension="${file##*.}" | |
base="${file%.*}" | |
convert "$file" -quality 60 "${base}.jpg" | |
done | |
``` | |
Crop transparent border around edges: | |
``` | |
convert image -trim +repage output | |
``` | |
Crop border around edges with fuzziness: | |
``` | |
convert image -fuzz 1% -trim +repage output | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment