Last active
January 30, 2021 19:06
-
-
Save FilipChalupa/bdfe0e96c2e444f8e438a06232a3e421 to your computer and use it in GitHub Desktop.
SVG to webmanifest PNGs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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