Skip to content

Commit

Permalink
Update image regeneration script to better support transparent images
Browse files Browse the repository at this point in the history
  • Loading branch information
OoLunar committed Aug 25, 2023
1 parent 9a18fff commit 1c742d0
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions tools/generate-assets.sh → tools/generate-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,10 @@ regenerate()
svgo --multipass --quiet "$1"

# Convert to PNG
convert -size 1024x1024 -background transparent "$1" "${1%.*}.png"
convert -background none "$1" "${1%.*}.png"

# Convert to ICO
# https://stackoverflow.com/a/15104985
convert -background transparent -colors 256 "$1" \
\( -clone 0 -resize 16x16 \) \
\( -clone 0 -resize 32x32 \) \
\( -clone 0 -resize 48x48 \) \
\( -clone 0 -resize 64x64 \) \
\( -clone 0 -resize 128x128 \) \
\( -clone 0 -resize 256x256 \) \
-delete 0 "${1%.*}.ico"
convert -background transparent -define "icon:auto-resize=16,24,32,64,128,256" "$1" "${1%.*}.ico"
}

# Iterate over each file matching the pattern "*.svg" in the "img" directory
Expand Down

0 comments on commit 1c742d0

Please sign in to comment.