ChapterÂ 10.Â Optimizing Images
The single most important thing you can do to improve performance is put your site on a dietâtake off (and keep off) all the bytes you put on under the stress of chasing the next killer feature. Optimizing images is one way to do just that. Historically, the question of which features to include was considered a business rather than an engineering decision, so page weight has rarely been discussed in performance circles, and yet it is extremely important to overall response time.
Response time for web pages is almost exactly correlated to page weight, and images tend to account for half of the size of typical web pages (see FigureÂ 10-1). Most importantly, images are an easy place to improve performance without removing features. Often, we can make substantial improvements in the size of an image with little to no reduction in quality.
FigureÂ 10-1.Â Images as a percentage of page weight for the Alexa top 10 global web sites
In this chapter, we focus on nonlossy optimizations, which result in a smaller overall file size with no loss in quality. Pixel for pixel, the visual quality of the original and final images is the same. The reduction in size often results from removing metadata, better compression of color or pixel information, or (in the case of PNG) removing chunks that are not necessary for the Web.
If you donât ...