Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shadow-like line&row compression artefacts when saving to webp #665

Open
michaylov opened this issue Mar 14, 2024 · 2 comments
Open

Shadow-like line&row compression artefacts when saving to webp #665

michaylov opened this issue Mar 14, 2024 · 2 comments

Comments

@michaylov
Copy link

Hello, guys,

I have stumbled upon a really strange issue when compressing webp images - shadow-like artefact or "bleeding" columns and rows. This happens only with certain images - uniform background and an object in the center. When compressing those to webp, the strange "shadows" often appear on the right and below the image. It is rarely noticeable with most colours though.

Original image (PNG, uniform background & object in the center):
image

After compressing with imagick to webp, the artefacts appear:
image

The same image with "bumped" contrast for easier recognition:
image

No special settings were used in compression:

$im = new Imagick();
$im->readImage('bullseye_yellow_bg.png');
$im->setImageCompressionQuality(70);
$im->writeImage('b.webp');

I considered libwebp but was unable to reproduce with any settings. Also, no luck with imagemagick's cli tool convert. This problem happens with the x86 version of imagemagick and not aarch64.

Any help would be appreciated.

@Danack
Copy link
Collaborator

Danack commented Mar 14, 2024

Hmm.

Also, no luck with imagemagick's cli tool convert.

Ugh.

I considered libwebp but was unable to reproduce with any settings.

Also, ugh.

You're already doing the things I would normally suggest.

Imagick is a really thin wrapper around ImageMagick, so it's unlikely the Imagick code is doing anything 'wrong', it's just that a particular set of circumstances results in an issue, that doesn't show itself otherwise.

This problem happens with the x86 version of imagemagick and not aarch64.

Can you say the exact versions of libwebp you're using on each of those platforms? https://www.google.com/search?q=linux+show+library+version

About the only useful thing I can suggest to try, is to run your program through valgrind e.g.

'valgrind php test.php'

And see if that shows any problem, as very occasionally there are things shown by that.

Please can you say what you're doing to adjust the contrast? It does make it easier to see the issue, but I'm having reproducing that effect.

The only people who are really going to be able to solve the issue, is going to be the people who maintain libwebp, which appears to have a project page here: https://github.com/webmproject/libwebp?tab=readme-ov-file

@Danack
Copy link
Collaborator

Danack commented Mar 14, 2024

Hello, guys,

Just for the record, it's just one person.

Somewhat dispassionately, even if not surprisingly, it's very rare for any users of the project to provide help to each other, unless those people share the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants