Skip to content

Instantly share code, notes, and snippets.

@benjaminblack
Last active March 15, 2018 19:19
Show Gist options
  • Save benjaminblack/4953a8f43e71d0e61a0e9287e928ac28 to your computer and use it in GitHub Desktop.
Save benjaminblack/4953a8f43e71d0e61a0e9287e928ac28 to your computer and use it in GitHub Desktop.
ImageMagick cheat sheet
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