Files
isdefoobaropen/scripts/generate-favicons.sh

18 lines
296 B
Bash
Executable File

#!/bin/bash
if [[ $# -lt 2 ]]; then
echo "Usage: $0 SOURCE PREFIX" >&2
exit 1
fi
SOURCE=$1
PREFIX=$2
SUFFIX=.png
SIZES=(16x16 32x32 96x96)
for size in "${SIZES[@]}"; do
target="${PREFIX}${size}${SUFFIX}"
convert -background none "$SOURCE" -resize "$size" "$target"
optipng "$target"
done