Starting with the database from the HTTP Archive’s July 1, 2011 run, the experimental steps were:
- Fetch, via HTTP, every PNG or JPEG URL listed in the archive.
- Upon retrieving each image, attempt to reduce its size with a type-specific optimizer program:
From the test results, the median size reduction possible for image files in the July 1, 2011 HTTP Archive survey was:
- 1.8% for PNG (sample size: 167,185)
- 2.3% for JPEG (sample size: 372,131)
The following graphs show the full distribution for each image type.
However, it is important to note that images constitute a larger fraction of total page size than scripts or stylesheets. From the July 1, 2011 HTTP Archive stats, images comprise 482KB of the average page’s weight, compared to 135KB for scripts and just 28KB for CSS.