Prestashop: Grey lines on generated images with white background

Created on 8 Sep 2020  路  14Comments  路  Source: PrestaShop/PrestaShop

Describe the bug

GD library that Prestashop is using to generate it's thumbnails is making strange artifacts and grey lines on images. It's very irritating on images with white background.

Steps to Reproduce

  1. Set your Prestashop image settings to standard - JPG and 85-90% quality.
  2. Make a product. Upload any image with white background.
  3. Go to FO and view it's thumbnail in product list and on product page.
  4. You will see grey artefacts on the background.

It's not visible on cheaper displays - it's visible on my Dell P-series display, Macbooks, iPhones etc.

Images

View them here:
http://www.trendo.cz/test_1.jpg
Darker version if you don't see it: http://www.trendo.cz/test_1_darker.jpg

How we can solve this

This problem can be solved by using another graphics toolkit available in PHP - Imagick.

Advantages:

  • No visual artifacts
  • Better image quality with the same compression
  • Lower file size
  • About the same speed
  • Lower code complexity (no calculating the center of the image etc.)

See my test here:
http://www.trendo.cz/imageTest.php

Additional information

  • PrestaShop version: 1.7.6.2
  • PHP version: 7.2
1.7.6.2 Bug FO Image Minor No change required

Most helpful comment

I add the label To Do :+1:

All 14 comments

Thanks for opening this issue! We will help you to keep its state consistent

Hi @Hlavtox,

I did not manage to reproduce the issue with PS1.7.6.7.
image
I used iPhone11.
Could you please try with this image if you have some issues?
image

Thanks!

@khouloudbelguith I see it on your screenshot. 馃槃

92495343-1634da00-f1f7-11ea-8cb7-6621e337d548

Nice catch @Hlavtox

Hello @Hlavtox !
I am using a macbook with LG display, I wasn't able to reproduce it :s
Capture d鈥檈虂cran 2020-09-08 a虁 17 37 45

@ngodefroy Not looking close enough.

If you don't see it, open Photoshop or GIMP and replace #fefefe with red and you get this.

replaced


@PierreRambaud It's gonna be fun reproducing this 馃槃 馃槃

@khouloudbelguith @ngodefroy The lines are perfectly visible on iPhone XS or 11 Pro with max brightness.

@Hlavtox, could you please provide me a screenshot about your Images generation options settings.

Thanks!

IMO it looks like an issue in the GD library. I found other people having similar problems and this open bug in libgd. I don't think we can do anything about it.

@eternoendless What if we move to Imagick? It is avaialble on 9/10 (if not all) PHP installs.

@Hlavtox We are also able to manage both. If Imagick is available use it, otherwise use the gd library

Hi @PrestaShop/prestashop-core-developers,

We need to close this issue or we can add it to the debug roadmap?

Thanks!

I add the label To Do :+1:

We are also able to manage both. If Imagick is available use it, otherwise use the gd library

@PierreRambaud Unless I'm mistaken, that's not the current behavior. So if it's a feature request, that should be expressed in a new issue. This bug can't and won't be fixed by us.

Was this page helpful?
0 / 5 - 0 ratings