Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

Added support for Windows 1.0 icons

Open radarhere opened this issue 2 years ago • 5 comments

Resolves #7320 by adding support for reading and writing device-independent Windows 1.0 icons.

http://fileformats.archiveteam.org/wiki/Windows_1.0_Icon was used as a reference for the specification.

Because these images contains white, black and transparent pixels, I chose LA for the mode.

The test image was created by the user in the issue.

Because .ico is already taken, the format needs to be passed in as an argument when saving.

im.save("newimage.ico", format="ICO1")

radarhere avatar Sep 29 '23 13:09 radarhere

Check out the samples as device dependent and independent in #7320

superbonaci avatar Sep 29 '23 20:09 superbonaci

Looking at "DEVDEP.ICO", it's actually not device-dependent, but in "both" formats.

I presume that it is also able to be added to our test suite, and distributed under the Pillow license? I've added that here as a test image for the "both" format, and manually changed the image I already had to register as device-dependent.

So this PR now reads device-independent, device-dependent, "both", and saves in device-independent format.

radarhere avatar Oct 01 '23 11:10 radarhere

Yes, you can add those icons of course to the test suite under any license. They are just randomly generated pictures trying to include all bitmaps, white, black and transparent. Not sure if the format could be generated more complicated or complete that that to include all use cases. I encourage anybody to try with ICONEDIT.EXE Microsoft editor.

superbonaci avatar Oct 01 '23 12:10 superbonaci

Ah, this duplicates some of the work I'd done in https://github.com/python-pillow/Pillow/pull/6965... :(

Anyway, if this eventually gets merged, I suppose I'll rebase my work on this.

akx avatar Nov 13 '23 15:11 akx

ImageMagick apparently added support for it but doesn't work: https://github.com/ImageMagick/ImageMagick/issues/6866

superbonaci avatar Nov 15 '23 19:11 superbonaci

Closing due to lack of interest.

radarhere avatar Apr 01 '24 11:04 radarhere

//TODO

superbonaci avatar Apr 01 '24 15:04 superbonaci

@superbonaci if that is a note to yourself, ok, but the intention from our side is that this is not something that will be done.

radarhere avatar Apr 01 '24 21:04 radarhere