.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:
parent
11adf0ff8d
commit
730319bcd1
9
.zshrc
9
.zshrc
@ -102,5 +102,14 @@ fi
|
|||||||
# If heroku toolbelt is installed, add it to PATH
|
# If heroku toolbelt is installed, add it to PATH
|
||||||
[[ -d /usr/local/heroku/bin ]] && PATH=$PATH:/usr/local/heroku/bin
|
[[ -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 PATH
|
||||||
export MANPATH
|
export MANPATH
|
||||||
|
Loading…
Reference in New Issue
Block a user