-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate-icons.sh
More file actions
executable file
·34 lines (25 loc) · 1.22 KB
/
Copy pathgenerate-icons.sh
File metadata and controls
executable file
·34 lines (25 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
SOURCE_PNG="assets/icon.png"
ICONSET_DIR="assets/icon.iconset"
ICNS_OUTPUT="assets/icon.icns"
ICO_OUTPUT="assets/icon.ico"
echo "Generating icons from ${SOURCE_PNG}..."
rm -rf "$ICONSET_DIR"
mkdir "$ICONSET_DIR"
sips -z 16 16 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_16x16.png" > /dev/null
sips -z 32 32 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_16x16@2x.png" > /dev/null
sips -z 32 32 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_32x32.png" > /dev/null
sips -z 64 64 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_32x32@2x.png" > /dev/null
sips -z 128 128 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_128x128.png" > /dev/null
sips -z 256 256 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_128x128@2x.png" > /dev/null
sips -z 256 256 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_256x256.png" > /dev/null
sips -z 512 512 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_256x256@2x.png" > /dev/null
sips -z 512 512 "$SOURCE_PNG" --out "$ICONSET_DIR/icon_512x512.png" > /dev/null
cp "$SOURCE_PNG" "$ICONSET_DIR/icon_512x512@2x.png"
iconutil -c icns "$ICONSET_DIR" -o "$ICNS_OUTPUT"
rm -rf "$ICONSET_DIR"
echo "Created ${ICNS_OUTPUT}"
magick "$SOURCE_PNG" \
-define icon:auto-resize=256,128,64,48,32,16 \
"$ICO_OUTPUT"
echo "Created ${ICO_OUTPUT}"