question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Favicon generated from demo

See original GitHub issue

Just an idea - I think it would be nice to have a favicon generated from one of the demos. I noticed when going through the code it uses an empty favicon:

https://github.com/GoogleChromeLabs/houdini.how/blob/main/public/index.html

<link rel="icon" href="data:,">

Here is a mockup using confetti demo.

image

Having a custom favicon is practical as well. When working with local build and comparing with main site I had many tabs open and had a hard time (well few seconds of clicking) to find the site because I had other sites open without a favicon at the time as well. And if it had the standard web.dev favicon it might get mixed with other ChromeLab sites. Granted maybe I have to many tabs open at the same time.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dollyjain51099commented, Dec 24, 2020

Hi @dollyjain51099

My advice would be to create several different icons from your favorite demos and see what you like best. Then submit that as your proposal. You can try with and without border to see what you like the best as well. I’m sure there are many more strategies for icons but 3 that come to the top of my mind would be:

  • Larger Icon, Logo, or Photo Image scaled down to the favicon size (probably the most common)
  • Something highly engineered to fix exactly 16x16 and 32x32 pixels
  • Something more along the lines of Art, and for this site I feel the Art generalization is good for this site because it’s a site showcasing Art created with a new CSS and JS Technology.

For the one I created I simply played around the confetti demo, took a print screen (screenshot), and cropped it to 16x16 pixels. If you are on Windows I would recommend the free and widely used program Paint.net https://www.getpaint.net/ which is what I used. On Mac for reference my icon/graphic program of choice is Sketch App https://www.sketch.com/ but it’s not free and only works on Mac. Adobe programs work great too but only if you already have a copy (or plan on actively using it) as you wouldn’t want to pay that much to create a simple icon. Of course there are many many more programs out there.

At a minimum you would want to create a 16 by 16 pixel icon probably in both *.png and then converted to *.ico format.

Although since your willing and would like to work on this I would recommend three (or four) icons which will cover the vast majority of all devices as of late 2020:

  • favicon.ico - Good to include both 16x16 pixel and 32x32 pixel icons. At least include the 16x16 version. PNG for the main favicon also works but generally it’s a good idea to include a favicon.ico file in the root of the site’s public directory because Web Browsers will request this file if no favicon is specified.
  • apple-touch-icon.png - 180x180 - This will cover the vast majority of iPhones and iPads - anything purchased or updated within the past 5 years or longer.
  • favicon-196x196.png - 196x196 as indicated by the file name. This will cover most Android Devices. The name of the file doesn’t matter but for clarity I would recommend this name.
  • If a Progressive Web App (PWA) is being created then a 512x512 icon is also needed but currently this site is not a PWA.

Once the icons are created it looks like this in the HTML (page location in my initial issue):

<link rel="shortcut icon" href="favicon.ico">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="196x196" href="favicon-196x196.png">

To convert 16x16 and 32x32 files from ico to png there are many websites available that you can google or locally you can use the widely used program ImageMagick (free for all OS’s) https://imagemagick.org/index.php

# With newer versions of ImageMagick the following should work:

# Combine 16x16 and 32x32 PNGs to a single [favicon.ico] file
convert favicon-16x16.png favicon-32x32.png favicon.ico

# Resize [image.png] to a [favicon.ico] with 3 different sizes [16x16, 32x32, 48x48)
convert image.png -define icon:auto-resize=16,32,48 favicon.ico

# Resize a single image to another since size
convert image.png -resize 196x196 favicon-196x196.png

If you end up creating Apple (180px) and Android Icons (196px) then you might want to try the demo you choose with 3 different large icons (example below I picked the circles demo and cropped it to a selection of 180x180 after trying different options on the demo).

image

You could even just create one large image (196x196) then scale it down to the other sizes using ImageMagick; that usually works well and looks nice.

I know this is a lot of info but hopefully it helps and possibly you can learn something from it. If you have any questions respond in the issue as I’ve created a lot of icons over the years so I can help with your questions. 😄

Favicon Resources and Info Note - Some of these are dated and include older devices as the icon sizes have typically changed every few years but overall the content is still relevant and good for learning.

Thank you for the help! I will do my best to present you the expected output.

1reaction
ConradSollittcommented, Dec 24, 2020

Hi @dollyjain51099

My advice would be to create several different icons from your favorite demos and see what you like best. Then submit that as your proposal. You can try with and without border to see what you like the best as well. I’m sure there are many more strategies for icons but 3 that come to the top of my mind would be:

  • Larger Icon, Logo, or Photo Image scaled down to the favicon size (probably the most common)
  • Something highly engineered to fix exactly 16x16 and 32x32 pixels
  • Something more along the lines of Art, and for this site I feel the Art generalization is good for this site because it’s a site showcasing Art created with a new CSS and JS Technology.

For the one I created I simply played around the confetti demo, took a print screen (screenshot), and cropped it to 16x16 pixels. If you are on Windows I would recommend the free and widely used program Paint.net https://www.getpaint.net/ which is what I used. On Mac for reference my icon/graphic program of choice is Sketch App https://www.sketch.com/ but it’s not free and only works on Mac. Adobe programs work great too but only if you already have a copy (or plan on actively using it) as you wouldn’t want to pay that much to create a simple icon. Of course there are many many more programs out there.

At a minimum you would want to create a 16 by 16 pixel icon probably in both *.png and then converted to *.ico format.

Although since your willing and would like to work on this I would recommend three (or four) icons which will cover the vast majority of all devices as of late 2020:

  • favicon.ico - Good to include both 16x16 pixel and 32x32 pixel icons. At least include the 16x16 version. PNG for the main favicon also works but generally it’s a good idea to include a favicon.ico file in the root of the site’s public directory because Web Browsers will request this file if no favicon is specified.
  • apple-touch-icon.png - 180x180 - This will cover the vast majority of iPhones and iPads - anything purchased or updated within the past 5 years or longer.
  • favicon-196x196.png - 196x196 as indicated by the file name. This will cover most Android Devices. The name of the file doesn’t matter but for clarity I would recommend this name.
  • If a Progressive Web App (PWA) is being created then a 512x512 icon is also needed but currently this site is not a PWA.

Once the icons are created it looks like this in the HTML (page location in my initial issue):

<link rel="shortcut icon" href="favicon.ico">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="196x196" href="favicon-196x196.png">

To convert 16x16 and 32x32 files from ico to png there are many websites available that you can google or locally you can use the widely used program ImageMagick (free for all OS’s) https://imagemagick.org/index.php

# With newer versions of ImageMagick the following should work:

# Combine 16x16 and 32x32 PNGs to a single [favicon.ico] file
convert favicon-16x16.png favicon-32x32.png favicon.ico

# Resize [image.png] to a [favicon.ico] with 3 different sizes [16x16, 32x32, 48x48)
convert image.png -define icon:auto-resize=16,32,48 favicon.ico

# Resize a single image to another since size
convert image.png -resize 196x196 favicon-196x196.png

If you end up creating Apple (180px) and Android Icons (196px) then you might want to try the demo you choose with 3 different large icons (example below I picked the circles demo and cropped it to a selection of 180x180 after trying different options on the demo).

image

You could even just create one large image (196x196) then scale it down to the other sizes using ImageMagick; that usually works well and looks nice.

I know this is a lot of info but hopefully it helps and possibly you can learn something from it. If you have any questions respond in the issue as I’ve created a lot of icons over the years so I can help with your questions. 😄

Favicon Resources and Info Note - Some of these are dated and include older devices as the icon sizes have typically changed every few years but overall the content is still relevant and good for learning.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Add a Favicon to Your Website with HTML
In this tutorial, we will walk through the steps involved in adding a favicon to your webpage using HTML. You can use any...
Read more >
How to Add Custom Dynamic Favicons in React & Next.js
Once you're ready, head down to the bottom of the page and click Generate your Favicons and HTML code. Favicon Generator will build...
Read more >
How to Add a WordPress Favicon to Your Site (3 Easy Options)
Need to add a WordPress favicon to your site? Check out this detailed guide to learn easy-to-use methods to get the job done!...
Read more >
Changing website favicon dynamically - Stack Overflow
To change favicons, just go favicon.change("ICON URL") using the above. (credits to http://softwareas.com/dynamic-favicons for the code I based ...
Read more >
Building an adaptive favicon - web.dev
... on how to build an adaptive favicon with SVG. Try the demo. ... Make a new file called favicon.svg and add the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found