Created
August 4, 2019 07:49
-
-
Save hgwr/9f7581c51a6f3c334a82ba0af258fc90 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
set -o errexit | |
set -o pipefail | |
set -o nounset | |
trap 'echo "Ctrl-C captured and exit."; exit 1' INT | |
outdir=$1 | |
if [ "$outdir" == "" ]; then | |
outdir=../out/ | |
fi | |
mkdir -p "$outdir" | |
for i in $( ls *.jpg ); do | |
echo "$i" | |
# convert "$i" -level 1%,99%,1.0 -type GrayScale -geometry 1200x -compress jpeg -quality 85 "$outdir/$i" | |
convert "$i" -level 20%,80%,1.0 -type GrayScale -geometry 1200x -compress jpeg -quality 85 "$outdir/$i" | |
# convert "$i" -level 10%,90%,1.0 -type GrayScale -geometry 1200x -compress jpeg -quality 85 "$outdir/$i" | |
# convert "$i" -level 30%,70%,1.0 -type GrayScale -geometry 1200x -compress jpeg -quality 85 "$outdir/$i" | |
# convert "$i" -threshold 55000 -depth 4 -geometry 758x1024 -compress jpeg -quality 85 "$outdir/$i" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment