JPEG compression and JPEG quality in WordPress
While working on part of the Branson’s Nantucket website I needed to find a way to reduce page load times. Of course there are many ways to do this but one thing that immediately stood out was JPEG file size. Some JPEGs were 400kb+ and there were a number of them to be loaded on one page. That may be fine for people with super-fast internet connections, but alas many people (myself included) sometime make due with relatively slow connections.
What was causing these huge file sizes? Well, the images are very high resolution files from a Canon 5D Mark II and they are then re-sized by WordPress to a fairly high-resolution size of approximately 1920×1080. But the real killer on file size was that the resulting WordPress generated JPEGs had very little compression applied to them. Specifically as of Jan 2nd 2013, WordPress defaults to 90% ‘Quality’ when it re-sizes uploaded JPEG images. Of course high-quality images are a good thing but for images viewed on the web, 90% can be a bit overkill.
I was left with a couple options:
- Manual – Manually upload custom sized images that I optimized myself
- Automatic – Adjust WordPress JPEG handling via a plugin or function
Automatic was my preference because otherwise it would be quite a pain to manually update JPEGs any time a new image was needed or an existing one was changed. It would really defeat the purpose of having image management integrated into WordPress.
With all that said, I did have an enjoyable time reading about JPEG optimization again. You probably know most of the stuff in the the articles below, but they are interesting nonetheless. Reading them actually reminded me of the old days of GIF optimization and the 216 color ‘web safe’ color palette
As for me, I ended up using the SimpleJPEGQuality WordPress Plugin
to set quality to 70% and that is working great for the time being. Images sizes are roughly one-half to two-thirds what they were before and now I can focus on improving other areas of the site. 🙂
JPEG Optimization Articles:
Clever JPEG Optimization Techniques | Smashing Magazinehttp://www.smashingmagazine.com/2009/07/01/clever-jpeg-optimization-techniques/When people talk about image optimization, they consider only the limited parameters offered by popular image editors, like the “Quality” slider, the number of colors…
WordPress JPEG Plugins:
SimpleJPEGQuality « WordPress Pluginshttp://wordpress.org/extend/plugins/simplejpegquality/installation/Upload the SimpleJPEGQuality folder to your /wp-content/plugins/ folder and activate it. Go to the media settings page in your WordPress admin panel and set the JPEG quality…
Exif-Remove « WordPress Pluginshttp://wordpress.org/extend/plugins/exif-remove/faq/Compatibility WordPress 3.5 3.4.2 3.4.1 3.4 3.3.2 3.3.1 3.3 3.2.1 3.2 3.1.4 3.1.3 3.1.2 3.1.1 3.1 3.0.5 3.0.4 3.0.3 3.0.2 3.0.1 3.0 2.9.2 2.9.1 2.9 2.8.6 + Plugin 1.3 1.2 1.1 1.0…
Programs for JPEG compression: