From 8fe5bf1295799a63aca7a16469771e257e5cfc49 Mon Sep 17 00:00:00 2001 From: Brian Woods Date: Wed, 22 Feb 2023 01:09:37 -0500 Subject: Add webp scripts and makefiles Add scripts for testing compression quality and converting collections of pngs to webps. --- webp/lossy_nearlossless_gen_images.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 webp/lossy_nearlossless_gen_images.sh (limited to 'webp/lossy_nearlossless_gen_images.sh') 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 -- cgit v1.2.3