.zshrc: Add GraphicsMagick version of smartresize

GraphicsMagick is faster, often produces better results, has more
sane command line options, etc...

Signed-off-by: Alan Orth <alan.orth@gmail.com>
This commit is contained in:
Alan Orth 2015-09-02 23:51:31 +03:00
parent 730319bcd1
commit b4a54dd0e4
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
1 changed files with 8 additions and 0 deletions

8
.zshrc
View File

@ -111,5 +111,13 @@ 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
}
# ported to graphicsmagick
# faster, more sane command line options, tags sRGB by default, etc
# image slightly larger but includes quite a bit of useful(?) metadata
# stripping with `jpegtran -copy none` strips 50KB+ off
gmsmartresize() {
gm mogrify -filter Triangle -define filter:support=2 -thumbnail $2 -unsharp 0.25x0.08+8.3+0.045 -dither -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 RGB -output-directory $3 $1
}
export PATH
export MANPATH