Files
colorhash/tools/genexamples.sh
Alek Ratzloff ad014b4ea4 Add ANSI color output, set that as the default
ANSI-based color output is available and now the default. Add a
-y / --output-type argument to select SVG or ANSI output. Also update
tools/genexamples.sh to use the SVG output type.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-05-30 11:38:33 -07:00

23 lines
713 B
Bash
Executable File

#!/bin/bash
set -eo pipefail
here="$(dirname "$(realpath "$0")")"
hashes=(md5 sha1 sha224 sha256 sha384 sha512)
matrices=(nibble randomart)
cd "$here/.."
find "examples" -type f -name '*.in' | \
while read infile; do
for hash in "${hashes[@]}"; do
for matrix in "${matrices[@]}"; do
svgfile="examples/$(basename -s .in "$infile")-$hash-$matrix.svg"
pngfile="examples/$(basename -s .in "$infile")-$hash-$matrix.png"
echo "Generating $svgfile"
python3 -m colorhash "$infile" --output-type svg --out "$svgfile" --hash "$hash" --matrix "$matrix"
echo "Generating $pngfile"
convert "$svgfile" "$pngfile"
done
done
done