]> Sergey Matveev's repositories - dotfiles.git/commitdiff
cjxl's higher effort is sufficient
authorSergey Matveev <stargrave@stargrave.org>
Mon, 9 Dec 2024 09:45:37 +0000 (12:45 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 9 Dec 2024 09:45:37 +0000 (12:45 +0300)
img/bin/my-jxll [deleted file]

diff --git a/img/bin/my-jxll b/img/bin/my-jxll
deleted file mode 100755 (executable)
index c25d4d4..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env zsh
-
-setopt ERR_EXIT
-tmp=`mktemp`
-trap "rm -f $tmp.pnm $tmp.jxl" HUP PIPE INT QUIT TERM EXIT
-case $1:e in
-pnm) cp $1 $tmp.pnm ;;
-gif) giftopnm <$1 >$tmp.pnm ;;
-png) pngtopnm <$1 >$tmp.pnm ;;
-webp) dwebp -mt -quiet -o $tmp.pnm $1 ;;
-*)
-    print unknown extension >&2
-    exit 1
-esac
-
-common=(--quiet --distance=0 --effort=10 --brotli_effort=11)
-prev=$(( 1 << 62 ))
-best=""
-zmodload -F zsh/stat b:zstat
-for g (0 1 2 3) {
-    opts=(--modular_group_size=$g)
-    cjxl $common $opts $tmp.pnm $tmp.jxl
-    zstat -A cur +size $tmp.jxl
-    [[ $cur -gt $prev ]] || {
-        prev=$cur
-        best=($opts)
-    }
-}
-zstat -A cur +size $1
-[[ $cur -lt $prev ]] && {
-    print $1 is smaller : $cur vs $prev
-    exit 2
-}
-cjxl $common $best $tmp.pnm $1:r.jxl