-
Notifications
You must be signed in to change notification settings - Fork 174
Expand file tree
/
Copy pathgenerate-microsoft-store-logos.sh
More file actions
executable file
·64 lines (55 loc) · 1.43 KB
/
generate-microsoft-store-logos.sh
File metadata and controls
executable file
·64 lines (55 loc) · 1.43 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Generate Microsoft Store logo variants from SVG source
# Requires: ImageMagick (brew install imagemagick)
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SVG_SOURCE="${SCRIPT_DIR}/docs/logo/logo.svg"
OUT_DIR="${SCRIPT_DIR}/docs/logo/microsoft-store"
mkdir -p "$OUT_DIR"
# All sizes to generate (WxH)
SIZES=(
"50x50"
"44x44"
"150x150"
"310x150"
"620x300"
"720x1080"
"1440x2160"
"1080x1080"
"2160x2160"
"300x300"
"71x71"
"1920x1080"
"3840x2160"
"584x800"
)
echo "Generating logo variants from: ${SVG_SOURCE}"
echo "Output directory: ${OUT_DIR}"
echo ""
for size in "${SIZES[@]}"; do
echo "Generating ${size}..."
# Extract width to determine if this is a small icon
width="${size%x*}"
if [ "$width" -lt 100 ]; then
# Small icons: render to intermediate size first, then downscale with Mitchell filter
magick -density 300 -background transparent "$SVG_SOURCE" \
-resize 512x512 \
-filter Mitchell \
-resize "${size}" \
-gravity center \
-extent "${size}" \
-quality 100 \
"${OUT_DIR}/logo_${size}.png"
else
# Larger sizes: use high density for sharp SVG rendering
magick -density 1200 -background transparent "$SVG_SOURCE" \
-resize "${size}" \
-gravity center \
-extent "${size}" \
-quality 95 \
"${OUT_DIR}/logo_${size}.png"
fi
done
echo ""
echo "Done! Generated files:"
ls -lh "${OUT_DIR}/"*.png