Change Thumbnail Quality in WordPress

Posted by Dr Koh on Monday Feb 25, 2008 Under Blog

I notice that WordPress has really really poor thumbnail image quality when I upload my photos online. It really spoil a photo or even discourage people to view/click your photo.

To change the thumbnail image quality:

Edit File:
/wp-admin/includes/image.php

Change:
if (!imagejpeg( $thumbnail, $thumbpath ) ) {

To:
if (!imagejpeg( $thumbnail, $thumbpath, 90 ) ) {

90 is the image quality of your thumbnail. My personal experience is that 85-90 are of very good quality. Not encourage to use 100 as it will generate big file size with virtually very little different in image quality.

Here’s the thumbnail from original WordPress default setting (I used trial and error to check the compression setting of WP default, should be around 60-65%, which is definitely TOO POOR for photography work):

File size = 19.52 KB

kkk_0694-before.JPG

Here’s after (80):

File size = 22.31 KB

kkk_0694-80.JPG

Here’s after (85):

File size = 26.22 KB

kkk_0694-85.JPG

Here’s after (90):

File size = 33.06 KB

kkk_0694.JPG

Here’s after (95):

File size = 47.69 KB

kkk_0694-95.JPG

Here’s after (100):

File size = 94.14 KB

kkk_0694-100.JPG

Hope this helps. :)

4 Responses to “Change Thumbnail Quality in WordPress”

  1. dodo Says:

    hi king

    now ,the code of 2.65 had lots of updata and changes, this method for v2.3 is no longer work.

    do you know to change the code in wordpress 2.6.5 or higher version ?

    thankyou~!!

  2. KhoKing Says:

    Hi dodo,

    Sorry, I am keeping my WP at lower version for this blog site, not sure how to change the codes in higher version of WP. I just don’t like the FLASH type of gallery or photo upload in the new WP.

  3. Can Sinan ARTUÇ Says:

    It is in the same file, but function is different (version: 2.8.4):

    if ( imagejpeg( $dst, $dst_file, apply_filters( ‘jpeg_quality’, 60, ‘wp_crop_image’ ) ) )

    You can change 60 to anything you want. Bigger values means more clean pictures but also more file sizes.

  4. Tinisha Ramus Says:

    Hi there just wanted to give you a quick heads up. The words in your post seem to be running off the screen in Opera. I’m not sure if this is a format issue or something to do with web browser compatibility but I figured I’d post to let you know. The layout look great though! Hope you get the problem fixed soon. Many thanks

Leave a Reply