I just came across with this very strange problem.

The case: I have these 2 images:

Green dress with gray background Green dress with white background

The images are identical. The only difference is that the 2nd image has a white background.

But when you visit the product's page you can see that the 1st image's colors are blurry while the colors of the 2nd image are correct. (see the Green color)

I did the test with a fresh installation of Magento without any extensions installed. The PHP version is 5.5.9-1ubuntu4.21

I also did the test with an online Magento demo. The results are the same. The green color is blurry.

It has nothing to with the ->setQuality() option. I did a test with $this->helper('catalog/image')->setQuality(100) and the final result is the same. The image that Magento produces has spoiled colors.

Is it a Magento bug, a Zend bug or a PHP bug?

3 Answers 3


The image that you provided has a color profile. It seems that Gd2, the image library that magento uses, strips away color profiles during processing, that's why your image looks different.

Related stack overflow question: https://stackoverflow.com/questions/5773032/how-to-stop-gd2-from-washing-away-the-colors-upon-resizing-images

  • Indeed, when I exported the images from photoshop "for web and devices" and reuploaded them to Magento the colors where ok. Mar 22, 2017 at 10:33

You can check below parameters for your image, check with your tweak and let me know

 <?php echo $this->helper('catalog/image')->init($_product, 'small_image')
    ->resize($_imgSize)->setQuality(99); ?>
  • The parameters don't change the final result. The final image has spoiled colors. Please use the images of my test and do a test of your own. You will be amazed by the results! Mar 20, 2017 at 12:24

You need follow code

<?php echo $this->helper('catalog/image')->init($_product, 'small_image')
    ->resize($_imgSize); ?>
  • I followed the code with xDebug but I can't figure out why the final image has spoiled colors. Please use my test images and perform a test of your own. When you compare the 2 final images you will notice that the colors of the 1st image only are spoiled. Mar 20, 2017 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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