Skip to content

WebP file size increased by 20-60%, compared to Pillow 7.1.2 #4786

Closed

Description

@pix666

What did you do?

Load the image linked below, convert it to WebP.

What did you expect to happen?

Same file size as with Pillow 7.1.2 (± 5%)

What actually happened?

File size increased by almost 50%, compared to Pillow 7.1.2.

File Size
Source (jpg) 214 779
Pillow 7.1.2 (webp) 108 450
Pillow 7.2.0 (webp) 159 964

What are your OS, Python and Pillow versions?

  • OS: Ubuntu 20.04
  • Python: 3.8.2
  • Pillow: 7.2.0
from PIL import Image
source = Image.open('source.jpg')
source.save('dest.webp', quality=80)

source

Activity

  1. radarhere commented on Jul 16, 2020

    @radarhere
    Member

    Testing, I find this is the result of #4547

  2. radarhere commented on Apr 28, 2021

    @radarhere
    Member

    Looking at the webp source code, the default 'method' value is 4 - https://chromium.googlesource.com/webm/libwebp/+/refs/heads/master/src/enc/config_enc.c#34

    If I pass in method=4 to the save method -

    from PIL import Image
    source = Image.open('source.jpg')
    source.save('dest.webp', quality=80, method=4)

    Then I get the same file size as before the change.

    So the different because we changed the default behaviour. I've created #5450 to resolve this by changing our default to 4 as well.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions