Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Converts a PNG to a Windows ICO file. Uses imagemagick instead of sips for conversion for nix-ness
#!/bin/bash
#The image you want to make into a Windows ICO file
#Requires imagemagick
orig=$1
mkdir tmp_ico_dir
# resize all the images
convert -scale 16 $orig tmp_ico_dir/icon_16x16.png
convert -scale 32 $orig tmp_ico_dir/icon_32x32.png
convert -scale 128 $orig tmp_ico_dir/icon_128x128.png
convert -scale 256 $orig tmp_ico_dir/icon_256x256.png
convert -scale 512 $orig tmp_ico_dir/icon_512x512.png
#convert -scale 1024 $orig tmp_ico_dir/icon_1024x1024.png
# create the .ico
convert tmp_ico_dir/*.png icon.ico
# remove the temp folder
rm -R tmp_ico_dir
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.