Skip to content

Instantly share code, notes, and snippets.

@hgwr hgwr/whitening.sh
Created Aug 4, 2019

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.