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

WebP is Larger than Original Image #510

Open
4 tasks
adamradocz opened this issue Aug 31, 2020 · 7 comments · May be fixed by #706
Open
4 tasks

WebP is Larger than Original Image #510

adamradocz opened this issue Aug 31, 2020 · 7 comments · May be fixed by #706
Assignees

Comments

@adamradocz
Copy link

Describe the bug
If the created WebP file is larger than the original PNG file, then delete the WebP version.

To Reproduce
test

  • Use the uploaded test image to reproduce the behavior.

Expected behavior
If the created WebP file is larger than the original PNG file, then delete the WebP version.

Screenshots
Capture

Backlog Grooming (for WP Media dev team use only)

  • Reproduce the problem
  • Identify the root cause
  • Scope a solution
  • Estimate the effort
@iCaspar iCaspar changed the title WebP is larger than PNG WebP is Larger than Original Image Mar 22, 2021
@iCaspar
Copy link
Contributor

iCaspar commented Mar 22, 2021

This is happening for any original image type: see #550 (comment)..

@joejoe04
Copy link
Contributor

joejoe04 commented Nov 5, 2021

One thing I've noticed is that even when the imagify_keep_large_webp filter is set to false, the resulting stats displayed in the Media Library are not totally correct.

Here is an example image's stats after optimization, with imagify_keep_large_webp set to true, and we can see negative values for both the "Original Saving" and "Overall Saving" values:

image

If I optimize the same image with the imagify_keep_large_webp filter set to false, the WebPs are not created and the "Original Saving" value is correct, but the overall saving value is not correct. It's still a negative number despite the -scaled image and all the thumbs having reduced file size:

image

@Klemart3D
Copy link

I cant understand how works Imagify compression algorithm, because when you use any other Image to WebP tool converter (eg: https://cloudconvert.com/jpg-to-webp), output WebP image is still lighter than original file, even with a high quality level. By sample, the WebP output image from my original image from #622 (3 Mb fullsized) is only 2.4 Mb (not 8.3 Mb like "compressed" by Imagify).

I've done a quick benchmark between 3 versions of the same light website:

  • JPG: Imagify is enabled with "Normal" compression. WebP option is disabled
  • WEPB: Imagify is enabled with "Normal" compression. WebP option is enabled and WebP images are displayed on website
    WEPB + PATCH: Imagify is enabled with "Normal" compression. WebP option is enabled and WebP images are displayed on website and I set the imagify_keep_large_webp filter to false.
  Total weight Imgs weight Loading time PageSpeed note MB PageSpeed note DK
JPG 4.05 Mb 2.50 Mb 1.96 s 23 60
WEPB 8.51 Mb 6.96 Mb 2.36 s 22 60
WEPB + PATCH 3.15 Mb 1.61 Mb 1,43 s 24 56

Even if Google seems not really interested in any of these versions, enable WebP is definitively not a good solution for resources (space disk, bandwidth, energy consumption, ecology, planet…)

This issue (weight problem) is also related with a unresized/unscaled WebP image issue (size problem), see #521.

There is so much critical issues to deals WebP images with Imagify (feature implemented since 2019 but never really tested) so I will go back to ShortPixel (less buggy).

@piotrbak piotrbak added module: convert webp priority: high Issues which should be resolved as quickly as possible type: enhancement labels Dec 13, 2021
@GeekPress GeekPress added this to the 2.1.1 milestone Oct 18, 2022
@remyperona
Copy link
Contributor

@piotrbak What do we want to do here exactly? We already have a filter to handle this case.

And the fact that some WebP images are larger than original ones is something that should be handle on the API side.

@piotrbak
Copy link

@Tabrisrp Here's what's supposed to happen in this PR:

  1. The filter should be set to false by default.
  2. Would it be possible to show a message here about the size problem with Webp?
    image
    image

@remyperona
Copy link
Contributor

Showing a message is complicated because each image and its thumbnails are processed individually, and the test for keeping the webp image is done for each, so you can have some that have it and some which don't.

@remyperona remyperona self-assigned this Dec 16, 2022
@remyperona remyperona removed this from the 2.1.1 milestone Jan 24, 2023
@zimdin12
Copy link

zimdin12 commented Nov 21, 2024

Still having same problem. WebP pics are bigger than jpg's. (difference for me is about 3x)
I am using latest Imagify with latest WP Rocket. (webp turned on from wp rocket).

Since my investigation is still ongoing then I do not have full details jet

Files in server are small, but dev tools show that they are huge.

Update. Problem might have been in WP 6.7(.0) or the fact that srcSet didn't use webp images.. not sure, but it kinda fixed itself during optimizations round.

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

Successfully merging a pull request may close this issue.

8 participants