Skip to content

Conversation

@radarhere
Copy link
Member

Resolves #6121

Two changes.

  1. For im.save("test.ico", sizes=((32, 32), (32, 32)), only save one 32x32 frame, not two.
  2. At its simplest, IcoImagePlugin resizes an image to save it at various sizes.
hopper().save("test.ico", bitmap_format="bmp", sizes=[(128, 128), (64), 64)])

At one step more complicated, it allows users to supply the smaller images themselves, through append_images.

hopper().save("test.ico", bitmap_format="bmp", sizes=[(128, 128), (64, 64)], append_images=[hopper().resize((64, 64))])

The user in the issue would like to save the image at different sizes, and also attach additional copies of certain sizes at different bit depths.

hopper().save("test.ico", bitmap_format="bmp", sizes=[(128, 128), (64, 64)], append_images=[hopper().resize((64, 64)), hopper("1")])

This PR allows that.

@hugovk hugovk merged commit c3d0dcd into python-pillow:main Mar 23, 2022
@radarhere radarhere deleted the ico branch March 23, 2022 22:16
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

Successfully merging this pull request may close these issues.

ICO: Add support for different color depths per icon size

2 participants