Using TimThumb part 1: Getting Started

TimThumb is no longer supported or maintained.
More information →

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 I will show you how TimThumb should be used – and introduce some new functionality.

In this post I will discuss the basic usage of the script – the minimum parameters to send, and some examples of usage.

Basic TimThumb Setup

Getting TimThumb to work is pretty straight forward. You need the php file, which you can download TimThumb from Google code, placed in a folder on your website. In the same directory as the timthumb.php file you need to add 1 directory. The directory should be called ‘cache‘ and needs to have its file permissions set to 775.

Simple explanation

TimThumb is a single php script that has a series of parameters passed to it through a query string. Whilst TimThumb has found a home in WordPress themes it is by no means limited to them – TimThumb can be used on any website to resize almost any image.


For TimThumb to work your web server should support the PHP programming language and the GD image library. In all the time I have been developing TimThumb I have yet to find a server it wouldn’t work on, so there’s a pretty good chance that TimThumb will work on your server.

In addition you should create one directory for saving thumbnails. This directory should be in the same directory as the TimThumb script and should be named cache. The cache directory should have it’s permissions set to 775.

Note that the cache directory should be the only file/ directory with 775 permissions. The script, the scripts folder, and any other folders should have the default value for your server.

Basic Parameters

The parameters below are the main ones used. With these you can resize almost anything.

  • src – this is the only required parameter. Absolutely everything else is optional. If you only specify the source property then the image will be cropped/ resized to the default dimensions (which are 100 x 100)
  • w and h – width and height. Totally optional but also almost essential, few people want the default sizes. The width and height can be any value, TimThumb will enlarge or shrink as required.
  • q – quality. This specifies the compression level of the images being cropped/ resized.

With just these parameters you can do everything you need to with the average TimThumb image. In the following parts I will outline the more advanced features of TimThumb including showing off some of the latest functionality.

In the next part I will be showing how to use some of the more advanced features in TimThumb, including how to make images greyscale and other filters.

Was it good/ useful/ a load of old rubbish? Let me know on Mastodon, or BlueSky (or Twitter X if you must).

Link to this page

Thanks for reading. I'd really appreciate it if you'd link to this page if you mention it in your newsletter or on your blog.

Related Posts

04 Nov 2010

TimThumb Troubleshooting Secrets

I often get asked questions about TimThumb and why it doesn’t work in certain situations. I can generally tell what is wrong with the script within about 60 seconds of being sent a demo url. Below are my top tips...
15 Mar 2012

TimThumb Configurations

As a TimThumb user, making changes to the settings has always been a bit of a pain. It’s possible, of course, but if you make changes – and then want to update the script – then you have to make...
12 Aug 2010

Using TimThumb Part 2: External Websites

Of all the TimThumb feature requests the most popular are being able to crop an image from a specified location, and being able to load images from external websites. Resizing images from external images was added at the start of...
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...