diff options
author | Brian Woods | 2023-02-22 01:09:37 -0500 |
---|---|---|
committer | Brian Woods | 2023-02-22 01:13:11 -0500 |
commit | 8fe5bf1295799a63aca7a16469771e257e5cfc49 (patch) | |
tree | a3ab4aeb3a682c5039ce15a880fe0dae97ed4d8b /webp/lossy_nearlossless_gen_images.sh | |
parent | 85f977cabc3f4bb976cec15bf2c2a2674542f424 (diff) |
Add webp scripts and makefiles
Add scripts for testing compression quality and converting collections
of pngs to webps.
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 |