Thumbnails image quality

Admiror Gallery is free extension for Joomla! 1.6. Joomla! 1.7 and Joomla! 2.5 based websites. Admiror Gallery is all in one, a simple and instant solution for rendering image gallery from folder with images, but very flexible and adaptable.
Post Reply
Message
Author
petersilie
Posts: 2
Joined: Sat Jan 19, 2013 6:25 pm

Thumbnails image quality

#1 Post by petersilie »

Hello,
What can I do, if the generated thumbnails are too much compressed – they look quite pixelated?
The size of the images, I've uploaded ist 533 x 800px and the thumbnails are 150 x 226px.
Is there any possibility to control the compression? The original pictures are web saved with 80% quality and look excellent, but maybe this is the problem here?
Thank you for any answers:)
petersilie

Admiror Gallery 5 - Fundraising Campaign

User avatar
Vasiljevski
Developer
Developer
Posts: 1258
Joined: Sat Aug 14, 2010 9:31 pm
Location: Novi Sad, Serbia
Contact:

Re: Thumbnails image quality

#2 Post by Vasiljevski »

When thumbnails are created we didn't set any Quality parameter, so it defaults, as written on http://php.net/manual/en/function.imagejpeg.php, to 75% in case of jpeg images.
There is 3 different cases when creating a thumbnail, for JPEG, PNG and GIF.

In case of JPEG we use imagejpeg(), JPG is a lossy compression and default quality is 75%.
You can change this in : [JoomlaRoot]\plugins\content\admirorgallery\admirorgallery\classes\agHelper.php:line 398

Code: Select all

@imagejpeg($dst_img, $thumb_file);
Just add 90 as a third parameter:

Code: Select all

@imagejpeg($dst_img, $thumb_file,90);
Experiment with the quality value and see if the quality of thumbs is improved.

Just be sure to remove the previous generated thumbnails after you make change in quality value. Because thumbnails are recreated only in case dimensions of thumbnails are changed.
Thumbnails are created in [JoomlaRoot]\plugins\content\admirorgallery\admirorgallery\thumbs.

In case of PNG we use imagepng(), and the default compression rate is 6. Different than JPEG, for PNG 0 is no compression (biggest file and best) and 9 is most compressed. But this doesn't affect the image quality because PNG is a lossless image format.
Same as for JPEG you can change the parameters in the function, but it will not produce better images.

In case of GIF we use imagegif(), this is also a lossless compression so quality cannot be changed. And the function dose not have an option to set quality.

Considering the above, you probably use JPEG images so you can try as I suggested for JPEG images.
Help Admiror Gallery become even better,
give us a review on JED

Post Reply