From 80914df09a95af07162e90f35ffbca561248885d Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 2 Aug 2025 03:55:35 +0200 Subject: Move scripts into aux/ --- aux/process-img | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 aux/process-img (limited to 'aux/process-img') diff --git a/aux/process-img b/aux/process-img new file mode 100755 index 0000000..ac25661 --- /dev/null +++ b/aux/process-img @@ -0,0 +1,36 @@ +#!/bin/bash + +usage() +{ + echo 'Usage: process-img [-f fuzz] file...' >&2 + exit 1 +} + +while getopts 'f:' opt +do + case "$opt" in + f) + fuzz="$optarg" + ;; + *) + usage + esac +done + +shift $(($OPTIND - 1)) +[ "$#" -eq 0 ] && usage + +for img in "$@" +do + ( + read w h < <(identify -format "%w %h" "$img") + magick "$img" \ + -alpha on -fuzz ${fuzz:-3%} -fill none \ + -draw "color 0,0 floodfill" \ + -draw "color 0,$((h-1)) floodfill" \ + -draw "color $((w-1)),0 floodfill" \ + -draw "color $((w-1)),$((h-1)) floodfill" \ + "${img%.*}.avif" + ) & +done +wait \ No newline at end of file -- cgit v1.2.3