Last active
April 24, 2020 21:03
-
-
Save bignimbus/fe3288c406127b696eb5a35afef1680c to your computer and use it in GitHub Desktop.
Here are some of my pet ImageMagick commands.
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
# converts a png image to jpeg | |
# all transparent regions will be converted to white | |
convert -flatten source.png destination.jpg |
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
# optimize an image asset | |
# no visible quality loss with a vastly reduced file size | |
# tested with png and jpeg assets | |
mogrify -filter Triangle -define filter:support=2 -unsharp 0.25x0.08+8.3+0.045 -dither None -posterize 136 -quality 82 -define jpeg:fancy-upsampling=off -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB ./path/to/img.jpg |
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
# same as imagemagick-magic.sh but with no posterize filter | |
mogrify -filter Triangle -define filter:support=2 -unsharp 0.25x0.08+8.3+0.045 -dither None -quality 82 -define jpeg:fancy-upsampling=off -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB ./path/to/img.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment