Skip to content

Instantly share code, notes, and snippets.

@SLIB53
Created September 28, 2023 05:58
Show Gist options
  • Save SLIB53/66627703f77d8bf8ea52c3a50fbd3349 to your computer and use it in GitHub Desktop.
Save SLIB53/66627703f77d8bf8ea52c3a50fbd3349 to your computer and use it in GitHub Desktop.
Favicon Generator
for size in "16" "32" "48" "57" "60" "72" "76" "114" "120" "144" "152" "167" "180" "1024"; do
magick favicon.png -resize ${size}x${size} favicon-${size}x${size}.png
done
@SLIB53
Copy link
Author

SLIB53 commented Sep 28, 2023

To run with a bloobox container, install ImageMagick:

dnf install ImageMagick

Then run the script:

sh favicon-generator.sh

@SLIB53
Copy link
Author

SLIB53 commented Dec 23, 2023

Link the favicon images in HTML, supporting the standard icon as well as other relationships:

<link rel="shortcut icon" href="assets/favicon.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="48x48" href="assets/favicon-48x48.png">
<link rel="apple-touch-icon" sizes="57x57" href="assets/favicon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="assets/favicon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="assets/favicon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="assets/favicon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="assets/favicon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="assets/favicon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="assets/favicon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="assets/favicon-152x152.png">
<link rel="apple-touch-icon" sizes="167x167" href="assets/favicon-167x167.png">
<link rel="apple-touch-icon" sizes="180x180" href="assets/favicon-180x180.png">
<link rel="apple-touch-icon" sizes="1024x1024" href="assets/favicon-1024x1024.png">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment