Skip to content

Instantly share code, notes, and snippets.

@samchouse
Last active August 23, 2021 16:28
Show Gist options
  • Select an option

  • Save samchouse/f5add75dc87b48b327801f72a1c9b5a3 to your computer and use it in GitHub Desktop.

Select an option

Save samchouse/f5add75dc87b48b327801f72a1c9b5a3 to your computer and use it in GitHub Desktop.
Create a set of icons to use for your PWA
#!/bin/zsh
filename=$1
sedFilename=$(echo $filename | sed -e 's/\..*$//g')
if [[ $filename == '' ]]; then
echo "Usage: iconset <file name>"
exit 1
fi
mkdir logos
cp "$filename" "logos/$filename"
cd logos
convert "$filename" -resize 72x72 "$sedFilename-72x72.png"
convert "$filename" -resize 96x96 "$sedFilename-96x96.png"
convert "$filename" -resize 128x128 "$sedFilename-128x128.png"
convert "$filename" -resize 144x144 "$sedFilename-144x144.png"
convert "$filename" -resize 152x152 "$sedFilename-152x152.png"
convert "$filename" -resize 180x180 "$sedFilename-180x180.png"
convert "$filename" -resize 192x192 "$sedFilename-192x192.png"
convert "$filename" -resize 384x384 "$sedFilename-384x384.png"
convert "$filename" -resize 512x512 "$sedFilename-512x512.png"
convert "$filename" -resize 1024x1024 "$sedFilename-1024x1024.png"
rm -rf "$filename"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment