1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Merge pull request #6047 from kambala-decapitator/macos-icon

[macOS] update app icon and generation script
This commit is contained in:
Ivan Savenko
2025-08-23 21:47:14 +03:00
committed by GitHub
3 changed files with 19 additions and 18 deletions

View File

@@ -1,18 +0,0 @@
from PIL import Image
import os, sys, shutil
img = Image.open(sys.argv[1])
if img.size != (1024,1024):
print("Input image must be 1024x1024. Provided image is %dx%d" % img.size)
os.mkdir("vcmi.iconset")
for i in [16, 32, 128, 256, 512]:
resized = img.resize((i, i), Image.ANTIALIAS)
resized.save("vcmi.iconset/icon_%dx%d.png" % (i, i))
resized2x = img.resize((2*i, 2*i), Image.ANTIALIAS)
resized2x.save("vcmi.iconset/icon_%dx%d@2x.png" % (i, i))
os.system("iconutil -c icns vcmi.iconset")
shutil.rmtree("vcmi.iconset")

19
osx/generate_icns.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
iconset='vcmi.iconset'
mkdir "$iconset"
cd "$iconset"
for multiplier in 1 2 ; do
if [[ $multiplier != 1 ]] ; then
suffix="@${multiplier}x"
fi
for size in 16 32 128 256 512 ; do
realSize=$(( $size * $multiplier ))
ln "../../clientapp/icons/vcmiclient.${realSize}x${realSize}.png" "icon_${size}x${size}${suffix}.png"
done
done
cd ..
iconutil -c icns "$iconset"
rm -rf "$iconset"

Binary file not shown.