How to convert a PIL Image into a numpy array?

You’re not saying how exactly putdata() is not behaving. I’m assuming you’re doing This is because putdata expects a sequence of tuples and you’re giving it a numpy array. This will work but it is very slow. As of PIL 1.1.6, the “proper” way to convert between images and numpy arrays is simply although the resulting array is in a different … Read more