Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions assets/logo/generate-png.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
# IMPORTANT — when to use this script:
# Use whenever SVG source files (icon-colored.svg, logo-horizontal.svg,
# social-preview.svg) are updated and the exported PNG assets need to be
# regenerated. Requires one of: Inkscape, librsvg (rsvg-convert), or
# ImageMagick (magick / convert).
# regenerated. Requires one of: Inkscape, librsvg (rsvg-convert),
# or ImageMagick (magick / convert).
#
# How it works:
# Auto-detects the available SVG-to-PNG conversion tool, then exports a full
# set of icon sizes (16, 32, 64, 128, 256, 512 px), logo-horizontal.png
# (400 px wide), and social-preview.png (1280×640 px).
# set of icon sizes (16, 32, 64, 128, 256, 512 px) plus icon-colored.png
# (512 px, transparent background — for GitHub profile picture upload),
# logo-horizontal.png (400 px wide), and social-preview.png (1280×640 px).

set -e

Expand Down Expand Up @@ -50,6 +51,7 @@ echo "Generating PNG files..."
# Generate icon sizes
case "$TOOL" in
inkscape)
inkscape icon-colored.svg --export-filename=icon-colored.png --export-width=512
inkscape icon-colored.svg --export-filename=icon-16.png --export-width=16
inkscape icon-colored.svg --export-filename=icon-32.png --export-width=32
inkscape icon-colored.svg --export-filename=icon-64.png --export-width=64
Expand All @@ -60,6 +62,7 @@ case "$TOOL" in
inkscape social-preview.svg --export-filename=social-preview.png --export-width=1280
;;
rsvg-convert)
rsvg-convert -w 512 -h 512 icon-colored.svg -o icon-colored.png
rsvg-convert -w 16 -h 16 icon-colored.svg -o icon-16.png
rsvg-convert -w 32 -h 32 icon-colored.svg -o icon-32.png
rsvg-convert -w 64 -h 64 icon-colored.svg -o icon-64.png
Expand All @@ -71,6 +74,7 @@ case "$TOOL" in
;;
magick|convert)
CMD="$TOOL"
$CMD -background none icon-colored.svg -resize 512x512 icon-colored.png
$CMD -background none icon-colored.svg -resize 16x16 icon-16.png
$CMD -background none icon-colored.svg -resize 32x32 icon-32.png
$CMD -background none icon-colored.svg -resize 64x64 icon-64.png
Expand Down
2 changes: 1 addition & 1 deletion assets/logo/icon-colored.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/logo/logo-horizontal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/logo/social-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading