Created
October 28, 2018 07:47
-
-
Save sagax/500171eb4d8cdd18053fa80d9b40fc4e to your computer and use it in GitHub Desktop.
compression original image with convert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[ -f "$1" ]] && \ | |
NAME="$1" && \ | |
sname=$(awk -F_original '{print $1}' <<< $NAME) && \ | |
extname=$(cut -d"." -f2 <<< $NAME) && \ | |
convert $NAME \ | |
-sampling-factor 4:2:0 \ | |
-strip \ | |
-quality 85 \ | |
-interlace JPEG \ | |
-colorspace sRGB \ | |
-resize 50%x \ | |
"${sname}.${extname}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment