5

I have a site that will have lots of images of large size. What is the best format that I should choose for displaying these images?

I need the website to load fast. I am jumbled with different formats of images like jpeg, png, gif, bmp, etc. Which to use in this case and why ?

marco-fiset
  • 8,791
mtk
  • 167

3 Answers3

16

Use JPEG for images with gradients (like photographs) and PNGs for images with flat colors and straight lines (like screenshots). Use GIF only if you need animations for some reason. Don't use BMP.

JPEG is lossy, so you get artifacts if you try to use it on screenshots.

PNG is lossless, so it looks great with screenshots, but the filesizes get really big for photographs.

GIF is kind of obsolete, PNG is better.

BMP is not a standard web image format.

2

In short, consider small thumbnail images as .png formatted wherever you list them in list. And spend some time on caching and its configurations.

In combination with this thumbnail images, have your large-sized images as png/jpeg. Generically speaking displaying list of all full-sized images will slow down your page load time.

However, having a wise caching configuration of the static web content through web-server is very important for performance, and it is a good way to go.

Yusubov
  • 21,498
2

If your aim is as you say to for "the web-site to load faster" then you might also want to look at making the images available via a Content Delivery Network (CDN) like Amazon Cloud Front or Max CDN.