The small images I upload to my site seem to have a quality problem in the catalog. I attached images, In the image Its little bit hard to see but there is a big different in the images. I need the image in the site to look the same like the image I upload.

One thing strange that in my local test site (in mamp pro and with the same code) the images in the site are in very good quality, the same like the images I upload. why there is a different from my mamp local site to my site in the server?

this is the code I call the images from the template:

<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->setQuality(100); ?>" />

enter image description here


You can set quality of images on this way:

Mage::helper('catalog/image')->init($product, 'small_image')->resize(180, 210)->setQuality(100);

or if you using a Varien_Image object:

/* Varien_Image */

However, their problem appears to be related to GD2, that the class magento used to make manipulation of images.

I've had problems with GD2 in Magento and managed to solve through the given solution this question (see the answer marked as a solution): https://stackoverflow.com/questions/8384678/magento-resize-image-quality

If you can not solve, you can use another class to handle the images: https://github.com/magento-hackathon/Perfect_Watermarks

  • #denis-spalenza its seems you didn't read all I wrote. I dont want to use image-magick and I already tryied the other solutions and didn't saw any changes. One of my question\ problem is that in my local mamp server the images look good, not like the ones in the server – user3270551 Sep 14 '15 at 16:52
  • @user3270551 I did it as well. There is no way I know what you would like to use and what have tried if you didn't write in your question. As I said, I believe it is related to GD and how it is being interpreted by PHP. I just quoted how to change the picture quality because I do not know exactly how your code is and if you had already trying this. Perhaps your PHP version is not equal on both environment? – Denis Spalenza Sep 14 '15 at 17:23
  • I posted how I call the image and I didn't change anything in the core. I using the same php version and still no luck. – user3270551 Sep 14 '15 at 20:05
  • Also php version, did you check GD version on both environment? Maybe recompiles php in your server using the same GD version. If both versions are equal, I'm sorry but I don't know how I could try to help more. Good luck. – Denis Spalenza Sep 14 '15 at 21:42
  • In my case i am not able to path like this "media/catalog/product/cache/1/small_image/270x270/9df78eab33525d08d6e5fb8d27136e95/c/a/home_product.jpg" instead of this i got this path ""media/catalog/product/cache/1/small_image/9df78eab33525d08d6e5fb8d27136e95/o/n/home_product.jpg"" – Sarfaraj Sipai Oct 23 '18 at 11:40

For the best results load the image twice the needed size. So if you need an image that is 300px x 300px, load it at 600px x 600px. After that shrink the image to 300px x 300px with CSS width:300px;height:auto. This way it will look good on retina displays.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.