Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Really, the moral here is that you should not use JPEG for icons and the like

And, more importantly, you should use images that are an appropriate resolution for the size they will be displayed. Even if you switch to PNG, using a 2000x2000 image for a icon displayed 20x20 is a waste.



> using a 2000x2000 image for a icon displayed 20x20 is a waste

The number of web sites that do this is enraging.


Some websites even do this for the favicon.


The favicon spec is a mess these days. The OG was 16x16 pixels, but now you're supposed to provide a whole slew of resolutions up to 192x192 and you can do SVG as well. And browsers have no consistency in how they pick the one to actually display.

https://en.wikipedia.org/wiki/Favicon#How_to_use


> browsers have no consistency in how they pick the one to actually display

The same Firefox on macOS shows different favicons depending on if I'm using it on the laptop screen or an external one (probably because of different pixel densities). It's crazy!


Using different icons for different pixel densities seem reasonable, especially with the density being a supported descriptor on which icon to use: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...



In my experience it works essentially everywhere to have a single png that's ~256*256px as a linked favicon, perhaps with a single .ico fallback.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: