-
-
Save cyjake/7762956 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to create a favicon with multiple image sizes and keep alpha transparency | |
- export your images in the desired sizes (16x16, 32x32 ... max 256x256) as PNGs + alpha | |
- install ImageMagick | |
Run this command (replacing the .png files for your own images): | |
convert favicon-16.png favicon-32.png favicon-64.png -colors 256 -alpha background favicon.ico | |
The `-alpha background` options is what maintains the alpha channel. You can reduce colors even more if you want, be careful about file size - a favicon with all sizes up to 256px will hit > 100kb. |
This great, although I do not understand
$ convert sapling.png \
\( -clone 0 -resize 16x16 \) \
\( -clone 0 -resize 32x32 \) \
\( -clone 0 -resize 48x48 \) \
\( -clone 0 -resize 64x64 \) \
-alpha background -colors 256 -delete 0 -bordercolor transparent -border 0 \
favicon.ico
this great
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add
-bordercolor
and-border
option for anti-aliased result.