Skip to content

Resize the width and height to 90% of original, but the image file size(bytes) become larger #6771

@chucklu

Description

@chucklu

What did you do?

resize the width and height of a image to 90%

What did you expect to happen?

I expect the file size(bytes) become smaller,

What actually happened?

The file size(bytes) become larger, the original file size is 80KB,
and the resized image file size become 700KB 89KB

What are your OS, Python and Pillow versions?

  • OS: win10 21H2
  • Python: Python 3.10.0
  • Pillow: '9.3.0' (PIL.version)
    im = Image.open(sourceFilePath)
    width, height = im.size
    width, height = int(width*0.9), int(height*0.9)
    im = im.resize((width, height))
    im.save(targetFilePath)

cat

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions