.zshrc: Add smartresize function

For quick and easy image resizing. From Smashing Magazine's great
article[0].

[0] http://www.smashingmagazine.com/2015/06/efficient-image-resizing-with-imagemagick/

Signed-off-by: Alan Orth <alan.orth@gmail.com>
This commit is contained in:
Alan Orth 2015-08-30 17:58:36 +03:00
parent 11adf0ff8d
commit 730319bcd1
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

9
.zshrc
View File

@ -102,5 +102,14 @@ fi
# If heroku toolbelt is installed, add it to PATH
[[ -d /usr/local/heroku/bin ]] && PATH=$PATH:/usr/local/heroku/bin
# resize images using ImageMagick
#
# $ smartresize DSC_0788.JPG 1920 outputdir
#
# see: http://www.smashingmagazine.com/2015/06/efficient-image-resizing-with-imagemagick/
smartresize() {
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
}
export PATH
export MANPATH