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

Save additional ICO frames with other bit depths if supplied #6122

Merged
merged 4 commits into from Mar 23, 2022

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