How do I automatically generate a favicon?

0
Hello, I'm creating a login API for clients, when the user generates "the page" he uploads the logo of his company to the server, but in addition to uploading the logo it also creates a favicon automatically, does anyone have any idea how to do it?

    
asked by anonymous 06.07.2018 / 14:59

1 answer

1

Hello.

In the past, many favicon .ico was used, nowadays all modern browsers already support png, which also provides greater quality and flexibility.

Just resize the image uploaded by the user and save in .png format to start using. You can do in various dimensions (16,32,64,96 etc.) but the default is to use 32x32 pixels. I do not know which language programmed your API, but there are libraries that do this or other APIs that do this for you.

I recommend you offer a feature that the user can crop the area to be used within the image, because the user can send a large image of the logo to the edge, making it even smaller as a favicon. Ideally, the logo should be as close to the edge as possible for best use. Or another field intended only for favicon.

Good luck.

    
06.07.2018 / 15:30