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

Support saving uncompressed ICO #2512

Closed
pdknsk opened this issue May 9, 2017 · 6 comments · Fixed by #5513
Closed

Support saving uncompressed ICO #2512

pdknsk opened this issue May 9, 2017 · 6 comments · Fixed by #5513

Comments

@pdknsk
Copy link

pdknsk commented May 9, 2017

Currently Pillow basically writes multiple PNGs into an ICO container, which is not supported by some applications that can read ICO. I'm not familiar with the ICO format, but I think biCompression here references the possible sub-formats.

@aclark4life
Copy link
Member

❓ Is this a feature request?

@aclark4life
Copy link
Member

Duplicate of #2513?

@pdknsk
Copy link
Author

pdknsk commented Jul 20, 2017

It's a different issue.

@JamesTheAwesomeDude
Copy link

Duplicate of #2513?

@pdknsk That issue was about sub-images; this issue is not a duplicate. This is a feature-request (which I share) for non-compressed ICO files; could it be re-opened?


The following is hard-coded:

When saving, PNG compression is used. Support for this was only added in
Windows Vista.

And, unfortunately, this is triggering mate-desktop/eom#310
(I'm not saying that that software isn't at fault, just that this issue is triggering that one)

@radarhere radarhere reopened this May 24, 2021
@radarhere
Copy link
Member

So from https://docs.microsoft.com/en-us/previous-versions//dd183376(v=vs.85)?redirectedfrom=MSDN, you're after "BI_RGB", "An uncompressed format", yes? Looking at https://en.wikipedia.org/wiki/ICO_(file_format), I'm guessing this would be BMP, instead of PNG. Does that sound right?

@radarhere radarhere changed the title support saving uncompressed ICO Support saving uncompressed ICO May 24, 2021
@radarhere
Copy link
Member

radarhere commented May 26, 2021

I've concluded that the BITMAPINFOHEADER structure isn't used, so BI_RGB is irrelevant.

I've created #5513 to add BMP format, through im.save("out.ico", bitmap_format="bmp"). Let us know if you have any thoughts.

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

Successfully merging a pull request may close this issue.

4 participants