Answer the question
In order to leave comments, you need to log in
PIL module changed?
I used to load pixels:
pixels = im.load()
and in a loop I could take channels:
r, g, b = pixels[i, j]
However, now this line gives an error:
TypeError: cannot unpack non-iterable int object
How to get pixel channels now?
Please pay more attention to this issue.
Answer the question
In order to leave comments, you need to log in
I would never have thought, but it turns out that the picture I used had less color depth than a regular picture! I need to be more careful with things like this.
Channels are taken via split() https://pillow.readthedocs.io/en/stable/reference/...
r, g, b = im.split()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question