Skip to content

Instantly share code, notes, and snippets.

@jaxn
Created June 5, 2017 03:35
Show Gist options
  • Save jaxn/63ce1a1a36d38e06407207c88790ed10 to your computer and use it in GitHub Desktop.
Save jaxn/63ce1a1a36d38e06407207c88790ed10 to your computer and use it in GitHub Desktop.
.bashrc for WSL
# shell function to compress image sizes
# smartresize inputfile.png 300 outputdir/
# credit: https://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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment