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_SPECIAL type: I;16, I;16L, I;16B, I;16N, BGR;15, BGR;16, BGR;24, BGR;32
- Remove
RGBX mode as full equivalent of RGB
- Keep widespread
1, P, L, LA, RGB and RGBA modes
- Keep alternative linear (or near linear) color spaces
CMYK and YCbCr
- Keep derivatives with multiplicated alpha
La and RGBa
- Apparently, keep wide modes
F and I
- 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
LAB and HSV
- Palette with alpha
PA. As I know palette supports RGBA modes, so it can handle "palette with alpha" in a different way
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 ifinImagingNewPrologueSubtype, this is not an experiment. This is just another unfinished feature which someone else needs to support.My suggestions are:
IMAGING_TYPE_SPECIALtype:I;16,I;16L,I;16B,I;16N,BGR;15,BGR;16,BGR;24,BGR;32RGBXmode as full equivalent ofRGB1,P,L,LA,RGBandRGBAmodesCMYKandYCbCrLaandRGBaFandIQuestionable modes:
LABandHSVPA. As I know palette supportsRGBAmodes, so it can handle "palette with alpha" in a different way