Added support for Windows 1.0 icons
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")
Check out the samples as device dependent and independent in #7320
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.
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.
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.
ImageMagick apparently added support for it but doesn't work: https://github.com/ImageMagick/ImageMagick/issues/6866
Closing due to lack of interest.
//TODO
@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.