Make Web Icons

Overview

Sources:

Script for generating apple-touch icons and favicons for websites from a source image.

Code

#!/usr/bin/env bash
 
# generate apple touch icons
convert "$1" -resize 180x180 apple-touch-icon-180x180.png
convert "$1" -resize 152x152 apple-touch-icon-152x152.png
convert "$1" -resize 144x144 apple-touch-icon-144x144.png
convert "$1" -resize 120x120 apple-touch-icon-120x120.png
convert "$1" -resize 114x114 apple-touch-icon-114x114.png
convert "$1" -resize 76x76 apple-touch-icon-76x76.png
convert "$1" -resize 72x72 apple-touch-icon-72x72.png
convert "$1" -resize 60x60 apple-touch-icon-60x60.png
convert "$1" -resize 57x57 apple-touch-icon-57x57.png
 
# create default apple touch icon
cp apple-touch-icon-180x180.png apple-touch-icon.png
 
# generate favicon
convert "$1" -resize 32x32 favicon-32x32.png
convert "$1" -resize 16x16 favicon-16x16.png
convert "$1" -resize 16x16 -resize 32x32 -resize 48x48 favicon.ico
 
# generate android chrome icons
convert "$1" -resize 192x192 android-chrome-192x192.png
convert "$1" -resize 512x512 android-chrome-512x512.png
 
# generate ms tile icon
convert "$1" -resize 150x150 mstile-150x150.png

Usage

chmod +x make-web-icons.sh
./make-web-icons.sh logo.png

Details

Requirements

This script requires ImageMagick for the convert command.

Install ImageMagick:

# ubuntu/debian
sudo apt-get install imagemagick
 
# macos
brew install imagemagick

Generated Files

FileSizePurpose
apple-touch-icon-*.pngVariousiOS home screen icons
favicon.icoMultiBrowser tab icon
android-chrome-*.png192/512Android home screen
mstile-150x150.png150x150Windows tiles

Appendix

Note created on 2025-12-23 and last modified on 2025-12-23.

See Also


(c) No Clocks, LLC | 2025