#!/bin/bash set -euo pipefail count=0 LC_ALL=C dir=public/images/screenshots rm -rf "${dir}" mkdir -p "${dir}" SECONDS=0 for file in original-screenshots/*.png; do newName="crystalis-$(printf '%04d' "${count}").png" thumbName="${newName%.*}-thumb.png" echo -n "${count}: ${file}... " magick "${file}" -filter point -resize 400% -strip "${dir}/${newName}" cp "${file}" "${dir}/${thumbName}" echo "done" count=$((count + 1)) done echo "done in ${SECONDS}s"