python-pillow / python-pillow/Pillow
Eliminate experimental modes
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 13.8k
- Forks
- 2.5k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 89
Description
Every time when I open Pillow's C sources, I absolutely scared by all these experimental modes. Do I need to worry how not to break them? Do I need to implement features for all of them? How can I write tests for them?
In my opinion, an experiment must have the following characteristics: hypothesis; subject; deadline or exit condition; metric; outcomes. When someone adds another else if in ImagingNewPrologueSubtype, this is not an experiment. This is just another unfinished feature which someone else needs to support.
My suggestions are:
- Remove following modes with
IMAGING_TYPE_SPECIALtype:I;16,I;16L,I;16B,I;16N,BGR;15,BGR;16,BGR;24,BGR;32 - Remove
RGBXmode as full equivalent ofRGB - Keep widespread
1,P,L,LA,RGBandRGBAmodes - Keep alternative linear (or near linear) color spaces
CMYKandYCbCr - Keep derivatives with multiplicated alpha
LaandRGBa - Apparently, keep wide modes
FandI - Create full list of the supported modes, monitor correctness of new or modified operations with all of them and include tests
Questionable modes:
- Alternative color spaces with signed channels
LABandHSV - Palette with alpha
PA. As I know palette supportsRGBAmodes, so it can handle "palette with alpha" in a different way
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing Pillow's C sources and the ImagingNewPrologueSubtype entry point, then inventory the listed image modes and their existing operations. Determine the supported-mode list and test coverage needed before removing or retaining modes; done means the mode policy is agreed and correctness is covered across all retained modes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- computer-graphics
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100