summaryrefslogtreecommitdiff
path: root/gen_favicon.sh
blob: a7bbc667efbd940bdfb3cd4a5e80277a0ee4df8d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

SIZES="16 32 64 128 256"

[[ -z $1 ]] && exit 1;
temp_dir=$(mktemp -d /tmp/favicon.XXXXXXXXXX)

for size in $SIZES
do
    convert "$1" \
        -depth 8 \
        -background transparent \
        -flatten \
        -resize \
        "${size}x${size}" \
        "$temp_dir/$size.png"
done

convert "$temp_dir/*" favicon.ico