When using webp without imageapi_optimize, the default quality is used, and the default is 100. This results in webp images that are larger than the corresponding png or jpeg.

One easy option would be to set the default to the same value as that used by Drupal core for jpeg images.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

floretan created an issue. See original summary.

floretan’s picture

Here's a patch that does that.

floretan’s picture

Status: Active » Needs review
floretan’s picture

Fixing an obvious logic mistake that slipped in :-)

Bart Vanhoutte’s picture

Thanks for your patch Florian.

From rigorous testing (a designer and a developer staring at pixels on a screen) we've come to the conclusion that it might be opportune to provide a separate setting for WebP quality instead of using the GD JPEG quality setting.

At the moment we've set WebP quality at 85% and JPEG quality at 80% to achieve similar visual quality and still have a large reduction in file size.

I have been working on a separate setting for WebP and will add this feature to the project soon.

Bart Vanhoutte’s picture

Category: Bug report » Feature request
Status: Needs review » Needs work
Bart Vanhoutte’s picture

I've added a separate setting for WebP quality.

Florian, would you be so kind to review this? /admin/config/media/webp/settings is where it's at.

Bart Vanhoutte’s picture

Status: Needs work » Needs review
JohnAlbin’s picture

Status: Needs review » Needs work

The patch doesn't apply to 8.x-1.x-dev.

JohnAlbin’s picture

Status: Needs work » Needs review
FileSize
525 bytes

Ah, the patch doesn't apply because it's already been committed to the 8.x-1.x branch.

So, I have a couple of changes.

1. Add a link to the configure page from the Drupal modules page.
2. "100" is a horrible default image quality. As stated in the original issue description: "This results in webp images that are larger than the corresponding png or jpeg." Let's change the default to 75 percent to match Drupal's default "jpeg_quality: 75".

  • alexmoreno committed 370a966 on 8.x-1.x authored by JohnAlbin
    Issue #2916775 by floretan, Bart Vanhoutte, JohnAlbin: Quality not...
alexmoreno’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.