Skip to content

Instantly share code, notes, and snippets.

Created June 27, 2015 13:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/2ac146cfd937f3814850 to your computer and use it in GitHub Desktop.
Save anonymous/2ac146cfd937f3814850 to your computer and use it in GitHub Desktop.
smartresize() {
if [ "$3" == "" ] ; then
echo "smartresize inputfile.png 300 outputdir/"
else
mogrify -path "$3" -filter Triangle -define filter:support=2 -thumbnail "$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 "$1"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment