From 8397666cb29f9f5286f9c421db7a6f863b070d11 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Tue, 31 Dec 2024 20:06:10 +0000 Subject: [PATCH] Write script to extract frames from a spritesheet --- scripts/frames.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 scripts/frames.sh diff --git a/scripts/frames.sh b/scripts/frames.sh new file mode 100755 index 0000000..926cab5 --- /dev/null +++ b/scripts/frames.sh @@ -0,0 +1,5 @@ +#!/bin/sh +width=$(identify -ping -format '%w\n' "$1") +height=$(identify -ping -format '%h\n' "$1") +framewidth=$(expr "$width" / "$2") +magick "$1" -crop "${framewidth}x$height" "$3"