-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |