diff options
Diffstat (limited to 'webp/lossy_nearlossless_gen_images.sh')
-rwxr-xr-x | webp/lossy_nearlossless_gen_images.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/webp/lossy_nearlossless_gen_images.sh b/webp/lossy_nearlossless_gen_images.sh new file mode 100755 index 0000000..4e65a76 --- /dev/null +++ b/webp/lossy_nearlossless_gen_images.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# SPDX-FileCopyrightText: 2023 Brian Woods +# SPDX-License-Identifier: GPL-2.0-or-later + +OUTDIR=lossy_nearlossless_images + +IN=" $( ls orig/*.png )" + +mkdir -p "$OUTDIR" +for INFILE in $IN ; do + for Z in {0..10} ; do + NUM=$(( Z * 10 )) + NUM_STR=$( printf "%03d\n" "$NUM" ) + cwebp \ + -mt \ + -near_lossless $NUM \ + -resize 1920 1080 \ + "$INFILE" \ + -o "$OUTDIR/$( basename -s .png $INFILE )-nl_$NUM_STR.webp" + done +done |