view mrjunejune/generate-icons.sh @ 212:84826b3c655b

[MrJuneJune] Forgot to add assets.
author MrJuneJune <me@mrjunejune.com>
date Sun, 15 Feb 2026 21:38:36 -0800
parents 3b47e82ac57e
children
line wrap: on
line source

#!/bin/bash

# Generate PWA icons from SVG
# Requires ImageMagick: apt-get install imagemagick

cd "$(dirname "$0")/src/public"

if ! command -v convert &> /dev/null; then
    echo "❌ ImageMagick not found. Please install it:"
    echo "   Ubuntu/Debian: sudo apt-get install imagemagick"
    echo "   macOS: brew install imagemagick"
    echo ""
    echo "Or use an online tool: https://realfavicongenerator.net/"
    exit 1
fi

echo "🎨 Generating PWA icons from epi_all_colors.svg..."

# 192x192 icon
echo "  → Creating icon-192.png..."
convert epi_all_colors.svg -resize 192x192 -background none icon-192.png

# 512x512 icon
echo "  → Creating icon-512.png..."
convert epi_all_colors.svg -resize 512x512 -background none icon-512.png

# Maskable icon (512x512 with safe zone - 80% of size)
echo "  → Creating icon-maskable-512.png..."
convert epi_all_colors.svg -resize 409x409 -background none -gravity center -extent 512x512 icon-maskable-512.png

echo ""
echo "✅ Icons generated successfully!"
echo ""
echo "Generated files:"
echo "  - icon-192.png"
echo "  - icon-512.png"
echo "  - icon-maskable-512.png"
echo ""
echo "Next steps:"
echo "  1. Verify icons look good: ls -lh src/public/icon-*.png"
echo "  2. Test PWA: Open site in Chrome → DevTools → Application → Manifest"
echo "  3. Run Lighthouse audit to check PWA score"