Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
deno icons
#!/bin/sh
# This script generates multi-size .ico files from the highly stylized "simple"
# Deno logos, designed by HashRock.
# The complication stems from the fact the the dimensions of the original .png
# files is 252x252 pixels. Naively rescaling these images to 256x256 or any
# other power of 2 produces ugly artifacts.
# Note that the output of the black-and-white logo transformation isn't
# entirely artifact-free because the source image has some glitches already.
# ImageMagick must be installed and available in $PATH to run this script.
# It was written for imagemagick 7.x, but version 6.x probably works too.
convert \
-size 256x256 \
\( xc:transparent -fill black -draw "circle 127.5,127.5 127.5,0.1" \) \
\( ./bw.png -repage +2+2 \) \
-background transparent -compose src-over -flatten \
+repage -depth 8 \
-define icon:auto-resize="256,128,96,64,48,40,32,24,20,16" -compress zip \
bw.ico
convert \
-size 256x256 \
\( xc:transparent -fill white -draw "circle 127.5,127.5 127.5,0.1" \) \
\( ./color.png -repage +2+2 \) \
-background transparent -compose src-over -flatten \
+repage -depth 8 \
-define icon:auto-resize="256,128,96,64,48,40,32,24,20,16" -compress zip \
color.ico
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.