Skip to content

Instantly share code, notes, and snippets.

@FilipChalupa
Last active January 30, 2021 19:06
Show Gist options
  • Save FilipChalupa/bdfe0e96c2e444f8e438a06232a3e421 to your computer and use it in GitHub Desktop.
Save FilipChalupa/bdfe0e96c2e444f8e438a06232a3e421 to your computer and use it in GitHub Desktop.
SVG to webmanifest PNGs
#!/bin/bash
directory="$PWD/public/manifest-icon/"
icon="icon.svg"
iconMaskable="icon-maskable.svg"
sizes=(32 36 48 72 96 128 144 192 256 384 512 1024 2048)
for i in "${sizes[@]}"; do
echo Resizing $i
name=$i"x"$i".png"
rsvg-convert -w $i -h $i "$directory$icon" -o "$directory$name"
name=$i"x"$i"-maskable.png"
rsvg-convert -w $i -h $i "$directory$iconMaskable" -o "$directory$name"
done
echo Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment