Log in

View Full Version : Is it possible to reduce a file's quality with timthumb.php?



qwikad.com
06-21-2014, 01:19 AM
Does anyone know how to just reduce a file's quality? I tried &q=XX but it didn't do it. So something like this would only make the image look fuzzy:

<img src="/timthumb.php?src=/images/myimage.png&w=400&h=350&q=90">

This didn't work either:

<img src="/timthumb.php?src=/images/myimage.png&q=90">

Any ideas?

PS I know I can set quality within the timthumb.php file. It's set to 90 I believe by default. I want to change quality individually. Adding &q=XX somehow makes the images look really fuzzy.

Beverleyh
06-21-2014, 11:03 AM
I think that the resulting fuzzy images indicate that the quality setting is in fact working - just not in the way you hoped.

I would suggest that the blurring has more to do with the GD library that timthumb uses. I experimented with image cropping and thumbnail generation a few months ago and got much better/crisper results using ImageMagik instead - I did not use a timthumb equivalent though (I wrote a custom script for the client) so I cannot recommend anything directly, but you can find lots of tutorials online https://www.google.com/search?q=gd%20library%20or%20imagemagick and https://www.google.com/search?q=gd%20library%20or%20imagemagick

This tutorial looks pretty nice http://coffeeshopped.com/2009/01/creating-image-thumbnails-using-php-and-imagemagick

qwikad.com
06-30-2014, 06:44 AM
Greatly appreciated. Will look into it. Sounds like it can be a good alternative.