Choose your image optimization wisely
Look at your image. Does it have millions of colors like a photograph does? Use JPEG.
Does it have flat color, as in a vector-based drawing with flat colored fills? Use PNG (or GIF).
Avoid using GIF. Use PNG instead. It is the open source equivalent (and even better) that was made to offer an alternative to the proprietary GIF image format.Wikipedia article
TLDR? Look at this table instead
|File Format||Image type|
|GIF||Flat color, limited color palette, simple transparency.|
|PNG-8||Flat color, limited color palette, simple transparency.|