Thumbnail Sharpness

  • Posts: 2
  • Thank you received: 0
8 years 3 months ago #264072

The thumbnail images being generated are blurry, I can't seem to find where to set the JPEG quality of the thumbnails. I have tried this both as a JPG and PNG, with and without the watermark and got the same results.

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 26251
  • Thank you received: 4040
  • MODERATOR
8 years 3 months ago #264074

Hi,

By default the JPEG compression quality is 95 (and PNG compression level is 9).
us3.php.net/manual/en/function.imagejpeg.php
us3.php.net/manual/en/function.imagepng.php

It is possible to change the value but there is no global setting for that, it requires to change the code which call the function "getThumbnail" of the image Helper and add in the options the (third parameter) the quality setting override.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0
8 years 1 month ago #267651

I wanted to report back on this. I was able to get better much better results by using PNG's only. PNG's are lossless, so the compression level does not affect the quality.

I scaled my images in PhotoShop to the exact pixel size as I am using for my full size images, so they do not get resized even when the watermark is added. (I verified this by bringing the images back into photoshop to compare to the original)

The Thumbnails DO loose sharpness compared to the same image resized in PhotoShop. I mitigated this somewhat by cropping in closer, and over-sharpening the original before import. This is due to limitations in GD, the resizing module that is default in PHP. This is a known issue that I found numerous references to. There is a better PHP module called ImageMagik, that also offers Sharpening options (at the cost of larger file size). I have used gallery components that give you a choice which method to use, that would be a good edition in the future.

Please Log in or Create an account to join the conversation.

  • Posts: 83937
  • Thank you received: 13600
  • MODERATOR
8 years 1 month ago #267656

Hi,

Yes. We used GD because it's the only one always available. It would be great to also support imageMagik if available on the server. That's for a future release.

Please Log in or Create an account to join the conversation.

  • Posts: 306
  • Thank you received: 42
  • Hikamarket Multivendor Hikashop Business
7 years 11 months ago #272135

Apologies for jumping in on this thread but I wondered if anyone has tried this technique to sharpen thumbnails using the GD library:
http://adamhopkinson.co.uk/blog/2010/08/26/sharpen-an-image-using-php-and-gd/
If it works it might be a useful option to add in a future release.

regards
Trevor

Please Log in or Create an account to join the conversation.

  • Posts: 83937
  • Thank you received: 13600
  • MODERATOR
7 years 11 months ago #272183

Hi,

Well, that's not really a solution to the problem on this thread.
This problem on this thread is that the resize algorithm in GD generates blur on the images.
What this code do is add a sharpening filter on the image (like the sharpening filter in photoshop).
While it might help a bit for some images, it's not a definite solution as sharpening and blur are different and you can't really "unblur" an image. It's like what you see on the movies with the guy zooming in and unbluring the image so that we can see the number plate of the car while you saw only a few pixels on the orginal image. That doesn't exist in real life. The only real solution is to not introduce the blur in the first place. Hence why we were talking about ImageMagik as a better solution for scaling rather than GD as it doesn't add that blur.

Please Log in or Create an account to join the conversation.

Time to create page: 0.072 seconds
Powered by Kunena Forum