aboutsummaryrefslogtreecommitdiff
path: root/images/matrix9.sh
blob: de37760199b69f11134df77ba6e2508909e7b385 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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"