Using tinypng WordPress plugin for image size optimization

To utilize and automate server-side image compression, we recommend TinyPNG ‘s plugin for WordPress. It’s ease of use (removing a step from Photoshop processing of images for upload to WordPress) and amazing compression algorithm make it a no-brainer for any website, especially one that uses a lot of images vs text.

When you upload your properly* re-sized images, tiny PNG does all of the compression for you on the server, in the background. It also tracks the images it has compressed so they aren’t re-compressed.

In short, it’s handy and saves more labor than it costs.

*this varies by theme and the use or intended display size of the image you are uploading- you likely have no reason to upload a 4032 x 3024 full resolution iPhone image to your site unless you love paying for storage

Setup in WordPress

First install and activate the Compress JPEG & PNG images plugin in WordPress.

Then click the link on your WordPress dashboard to set up your Account with TinyPNG (or go to the TinyPNG developer page directly) and enter your email and credit card information to get your API Key.

When you set up an account, you get the first few hundred images and thumbnails compressed for free, after that they are a few hundredths of a cent each. There is a handy calculator on their website, below are a few tips on using it.

Usage Calculation

To help you calculate your usage I’ll use an example of one site we developed and host.

The client added 540 original images one month. Their theme creates 20 thumbnails* of each image (if the original was correctly sized when uploaded).

*We have since decreased this to 15 thumbnails, we weren’t using 5 of the sizes generated in our layouts and so were just wasting resources– yeah, something else to look into! You can see what thumbnails are being produced, usually, in your theme’s functions.php file. How you go about seeing which ones you actually used is a topic for another post.

So back to our calculations …

540 x 20 = 10,800

Which means TinyPNG needed to process 10,800 thumbnail images and the original 540 for a total number of 11,340 images.

10,800 thumbnails + 540 original images = 11,340 images compressed

They were charged $87 for that month. If you upload like 30 photos a month, you’ll just get to enjoy the service without renumeration, which is nice.

Entering the API Key

Once you have your API key from TinyPNG, copy and paste it into the API key field in Settings>Compress JPEG & PNG images admin page. Adjust your settings to taste, and let the server do the work.

Leave a Reply