aboutsummaryrefslogtreecommitdiff
path: root/create-demo.sh
blob: 95de96942d6a3e073894fa15b3dababe493c2168 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

temp_name="demo.tmp.pgm"

clean() {
	rm -v "$temp_name"
}

create_demo() {
	echo "::: Invoking fractal-gen through pnminvert for negative PGM image"
	./fractal-gen -p any -s "$1" -i "$2"| pnminvert > "$temp_name"
	echo "::: Invoking ImageMagick to convert to PNG"
	convert "$temp_name" "$3"
	echo "::: Success. Final image is $3"
}

hash pnminvert || exit
hash convert || exit
trap clean EXIT

create_demo 768 75 demo-low-iterat.png
create_demo 768 10000000 demo-high-iterat.png