aboutsummaryrefslogtreecommitdiff
path: root/images
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2023-04-25 10:40:06 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2023-04-25 10:40:06 +0200
commit6ec0f9b2a2475d0bf39fc85b5dc38597d0df7542 (patch)
treeb75196929badbe55992dc886f53a96a16e9afa4d /images
parent7212da7e707a9e17b7182281e4d912a88f7f9cea (diff)
downloadscripts-6ec0f9b2a2475d0bf39fc85b5dc38597d0df7542.tar.gz
scripts-6ec0f9b2a2475d0bf39fc85b5dc38597d0df7542.zip
Added folder for scripts for games and script to join images in 3x3 grid.
Diffstat (limited to 'images')
-rwxr-xr-ximages/matrix9.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/images/matrix9.sh b/images/matrix9.sh
new file mode 100755
index 0000000..de37760
--- /dev/null
+++ b/images/matrix9.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# matrixh9.sh: Combine 9 750x1050 images in a grid of 3x3
+#
+# Usage: matrix9.sh FILE...
+
+usageMessage="Usage: ${0} FILE..."
+
+error() {
+ printf '%s error: %s\n' "$0" "$*" >&2
+}
+
+errorAndUsage() {
+ printf '%s error: %s\n%s\n' "$0" "$*" "$usageMessage" >&2
+}
+
+convert \
+ "$1" -extent 2250x1045 \
+ "$2" -gravity center -composite \
+ "$3" -gravity east -composite \
+ "/tmp/row01.jpg"
+
+convert \
+ "$4" -extent 2250x1045 \
+ "$5" -gravity center -composite \
+ "$6" -gravity east -composite \
+ "/tmp/row02.jpg"
+
+convert \
+ "$7" -extent 2250x1045 \
+ "$8" -gravity center -composite \
+ "$9" -gravity east -composite \
+ "/tmp/row03.jpg"
+
+convert \
+ "/tmp/row01.jpg" -extent 2250x3135 \
+ "/tmp/row02.jpg" -gravity center -composite \
+ "/tmp/row03.jpg" -gravity south -composite \
+ "page$(date +%H%M%S).jpg"