Skip to content

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

 stands forvaluesWhat it does
srcsourceurl to imageTells TimThumb which image to resize › TimThumb basic properties tutorial
wwidththe width to resize toRemove the width to scale proportionally (will then need the height) › TimThumb width tutorial
hheightthe height to resize toRemove the height to scale proportionally (will then need the width) › TimThumb height tutorial
qquality0 – 100Compression quality. The higher the number the nicer the image will look. I wouldn’t recommend going any higher than about 95 else the image will get too large › TimThumb image quality tutorial
aalignmentc, t, l, r, b, tl, tr, bl, brCrop alignment. c = center, t = top, b = bottom, r = right, l = left. The positions can be joined to create diagonal positions › TimThumb crop position tutorial
zczoom / crop0, 1, 2, 3Change the cropping and scaling settings › TimThumb crop scaling tutorial
ffilterstoo many to mentionLet’s you apply image filters to change the resized picture. For instance you can change brightness/ contrast or even blur the image › TimThumb image filter tutorial
ssharpen Apply a sharpen filter to the image, makes scaled down images look a little crisper › tutorial
cccanvas colourhexadecimal colour value (#ffffff)Change background colour. Most used when changing the zoom and crop settings, which in turn can add borders to the image.
ctcanvas transparencytrue (1)Use transparency and ignore background colour



Ben View All

Ben is a lifelong Nintendo fan who also likes to build websites, and develop games. He also buys way too much Lego.

37 thoughts on “Complete TimThumb Parameters Guide Leave a comment

  1. Why not in Parameters max min ?

    if jpg pixels 300x300px = timthumb = 100×200
    if jpg pixels 300x100px = timthumb = 100×100

    but make w&h paramer -> jpg pixel 300×100 = timthumb = 100×200 (zoom)

      • Any plans to allow percentages instead of Pixels?

        I’ve migrated to the LessIsMore framework which adjusts page width for the device/resolution viewed on…

        Timthumb is kinda redundant unless it can do something similar with percentages…

        Modern designers no longer design for a fixed width on screen then different pages for different media…and most webpages aren’t viewed on a screen at all nowadays…

      • Hi – using percentage widths won’t help with what you want to do. I’m a web designer – so I am well aware of responsive designs (try resizing your browser) however making TimThumb accept percentages won’t change anything. You should read up on responsive images – I would recommend the max-width css property. No images in responsive design change actual dimensions – they are scaled in the browser.

      • Hi Ben,
        Any plan for max-width and max-height parameter?
        I was thinking that it could be helpful when I load pictures using ajax request. so it will render resized image based on browser size instead of full image. Well, I can pass value as width param, but I can never sure that all images will be larger than given width.


  2. Great script! Love it!
    But could you please add a parameter to stop upscaling small images and keep the original size of an image if it’s smaller than the size given at w or h?!

  3. Is there a way to remove the black spaces on top and at the bottom of the image like youtube thumbnail for example ?
    In general, can I cut parts of the image with TimThumb ?

  4. I see that TT crops images when supplied with both a width and height. Is there a way to make it proportionally fit the image to a container?

    IOW: if I have an image 500 x 500 and I have a space 250 x 500, the image should be resized to 250 x 250. Is this possible?

  5. Does timthumb show image alt tags?

    The script is used on a number of websites I own and it does not appear to show image alts.

    • TimThumb resizes images – it has nothing to do with the html used on the website. You will need to edit your template to make the alt tags display.

  6. Hi.

    When I work with external files (in the same server, but a different URL), the load of that images go very slowly.
    How can I fix?


    • You should only use images on the same domain. It doesn’t matter what the server is – if the images are on a different domain then they will be copied over to the domain that hosts timthumb – and this is slow.

  7. Can you set a max height and max width so the picture will always fit between the dimensions, but will keep it’s proportions?

    Great work for the rest, I love your script!

  8. In my project your timthumb.php is working well.
    But I want to give the cache file name that is save in cache folder to my image src.
    Then is there any way to do it? Please suggest me!!!!!

  9. Hi
    Please, i have read the whole thing and comment and still ct equal to 0 or 1 or true does not work for gif images. It shows some black background where it was supposed to be transparent. Please, what to do ?

    • I would guess the colour profile is being removed from the image.

      Keep in mind that I no longer use or recommend TimThumb.

  10. Ben, is’t it possible to replace your final script AND remote_addr checking to reject running of the sections of your script that has to do with edits? Since the developer would test his/her page on the page from a particular IP, he/she would be the only one creating those images and yet everyone else can read it.

    Practically speaking, this would prevent one from deleting the TT generated cache, but that’s a limitation I am willing to live by and find a diffferent solution for.

    2nd and last question, do we really install iMagicK to use your CT transparency param?

Leave a Reply

Your email address will not be published. Required fields are marked *