Skip to content

Commit

Permalink
scripts: update icon
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Dec 13, 2021
1 parent 55aece2 commit 009083f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Binary file modified scripts/bin/icon.ico
Binary file not shown.
Binary file added scripts/bin/icon.psd
Binary file not shown.
24 changes: 24 additions & 0 deletions scripts/generate_icons
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# regenerate the .ICO file from .PSD.
set -ex
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "$SCRIPT_DIR"

rm -f bin/icon.ico bin/icon*.png bin/icon*.bmp

# PNG compression for Windows 10+
for size in 256 128 64 48 32 16; do
convert 'bin/icon.psd[0]' -filter lanczos -resize ${size}x${size} bin/icon${size}.png
pngquant bin/icon${size}.png
zopflipng -y bin/icon${size}-fs8.png bin/icon${size}-fs8.png
done

# BMP for Windows 7
for size in 32 16; do
convert bin/icon${size}-fs8.png bin/icon${size}.bmp
done

# NOTE: image order is important for certain software.
convert `ls bin/icon*.bmp|sort -rV` `ls bin/icon*-fs8.png|sort -rV` bin/icon.ico

rm -f bin/icon*.png bin/icon*.bmp

0 comments on commit 009083f

Please sign in to comment.