TimThumb Quality Settings

TimThumb is no longer supported or maintained.
More information →

Recently I have had a couple of emails about changing the amount of compression on TimThumb cropped images. The change itself is really easy, however I thought I would write it up as a reference for those who aren’t aware of it’s existence.

To change the level of compression all you have to do is edit the ‘q’ (which stands for quality) parameter in the query string.

If you don’t set the value then a default value of 80 will be used. This generally gives a good trade off between speed and quality, however if you are running a photo site or need to optimize your images for speed, then perhaps you will want to tweak things.

The allowed values are between 0 and 100.

  • q=0 is the most compression you can have on the image
  • q=100 is the least compression – totally uncompressed

Personally I would never use a quality of 100, it will increase the file size massively for little to no visible gain. If you want to increase the quality then around 95 is the highest you would need to go. The quality level there should be enough for most people.

Let me know what you think on Mastodon, or BlueSky (or Twitter X if you must).

Related Posts

21 Feb 2012

Complete TimThumb Parameters Guide

It was recently pointed out to me that there’s no single place to get a list of all the TimThumb parameters so I thought I would put together a page explaining them, and link to the relevant tutorials/ explanations.TimThumb Parameters...
06 Jul 2009

A Brief History of TimThumb

When we were building Mimbo Pro – Darren came up with the idea of automating the image thumbnail resizing – and this was the idea that sparked the development of TimThumb.This was all part of making the theme site as...
05 Aug 2010

Using TimThumb part 1: Getting Started

TimThumb has always been built with simplicity in mind. However there are a few things it can do that have not been exposed before.Inspired by a comment from RBhavesh I have decided to write a series of posts in which...
27 Sep 2014

TimThumb is No Longer Supported or Maintained

A long time ago – when making our first premium WordPress theme, Darren and I made TimThumb. TimThumb has been amazing – but it’s also not been without it’s share of problems.In particular in 2010 there was a major security...
06 Dec 2010

TimThumb: Improved Speed and Other Changes

Recently, when I haven’t been working on WPAdvent, I have been tweaking and improving TimThumb. In fact there’s been a couple of cool new features added that make it a much more useful peice of kit.The big changes boil down...
01 Jul 2014

I No Longer Use TimThumb – Here’s What I do Instead

Last week there was a second exploit found in TimThumb. Thankfully it was no-where near as bad as the first one – but it raised an interesting question of whether TimThumb is even needed anymore.TimThumb was made to be useful...