Conversation
The modes are mentioned in the docs, but weren't part of ImageMode.
|
Did you read the instructions for the Windows build, or just the sample script? I think most of your issues with it are explained in the longer documentation: https://github.com/python-pillow/Pillow/blob/main/winbuild/build.rst For example, you do not need to pass the
A known issue, sort of, #5811 (comment). You might notice at the bottom of this PR it says |
@nulano Neither, because I missed the full instructions. I found Readme.md and it appeared to get me close enough, so I didn't follow the links therein. The full instructions indeed make the script cleaner and I should have read them; my bad. If you don't think it is worthwhile to change or add to the existing example then let's not worry about it. That's why I put it as a side note to begin with; mainly to see if it is useful and/or if there is any interest in it :)
Then it's all good from my side 👍 |
src/PIL/ImageMode.py
Outdated
| "HSV": ("RGB", "L", ("H", "S", "V")), | ||
| # extra experimental modes | ||
| "RGBa": ("RGB", "L", ("R", "G", "B", "a")), | ||
| "BGR": ("BGR", "L", ("B", "G", "R")), |
There was a problem hiding this comment.
@radarhere Sure, we can remove it. In this case, what should be the base mode for the respective BGR;X? That mode itself?
There was a problem hiding this comment.
You've already listed the base mode for BGR;* as just RGB.
There was a problem hiding this comment.
@radarhere Oh, right. That was unintentional on my part. Initially I thought the basemode for BGR;* should be BGR and added mode BGR correspondingly.
However, since RGB is the desired mode, I will keep it and drop mode BGR.
Edit: Done :)
Fixes #5933
This PR adds the modes mentioned in the docs to ImageMode. It also adds the mode
BGRto be used as a basetype for the missing modes.Sidenote: To get pillow 9.1.0.dev0 to build on Windows I had to do some modifications to the script in
winbuild\README.md, e.g., because the script/snippet builds for python3.8, but calls python3.7 to prepare - which I don't have. I will leave my modified script here, since I don't know where else to put it, but if there is interest in a dedicated DOC PR for this, I can do that, too:Sidenote2: I didn't manage to get the full test suite to pass after building pillow. One test (
Tests/test_image_access.py::TestEmbeddable::test_embeddable) keeps failing. However, I think this is because the test can't findpython38.libon my system rather than something related to the PR.