Incorrect colour formats when using PIL image #568
Replies: 2 comments 1 reply
-
What are you using to 'show' the images? The inbuilt PIL .show method should give a correctly ordered representation, but as an example OpenCv has a reversed default representation.
|
Beta Was this translation helpful? Give feedback.
-
Ok. Glad you've got a way around it. The amended code below captures direct to an array, rather than to an image and then converting to an array, and does seem to respect the alternative RGB888 and BGR888 configurations
Regards |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
If I use
image = picam2.capture_image ("main")
I always end up with an image that has the red and blue the wrong way round irrespective of whether I specify RGB888 or BGR888 for the format.
However if I instead do
array = picam2.capture_array ("main")
image = Image.fromarray(array, mode = "RGB")
Then the colours in the image are correct when i use RGB888 and red and blue swapped as expected if I use BGR888
Can anyone help with why the first does not work correctly as I would rather avoid the double handling of the data.
Mike Lerwill
Beta Was this translation helpful? Give feedback.
All reactions