TypeError: Image data can not convert to float
I am trying to create a 16-bit image like so: But I get the error TypeError: Image data can not convert to float.
I am trying to create a 16-bit image like so: But I get the error TypeError: Image data can not convert to float.
I am trying to create a 16-bit image like so: But I get the error TypeError: Image data can not convert to float.
The following works for Python 3: References: https://github.com/python-pillow/Pillow/pull/1151 https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst#280-2015-04-01
I had this problem as well with Python 3.6. I just avoided the problem by uninstalling pillow (4.1.0) and then installing an older version of pillow (4.0.0). It seems to run okay with the older version.
I had a same issue. instead of fixed the issue
Did you setup PIL module? Link You can try to reinstall it on your computer.
I was experiencing a similar issue. Fixed it by pip installing WITHOUT sudo. instead of
Define a maximum size. Then, compute a resize ratio by taking min(maxwidth/width, maxheight/height). The proper size is oldsize*ratio. There is of course also a library method to do this: the method Image.thumbnail.Below is an (edited) example from the PIL documentation.
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
On some installs of PIL, you must do instead of import PIL (PIL is in fact not always imported this way). Since import Image works for you, this means that you have in fact installed PIL. Having a different name for the library and the Python module is unusual, but this is what was chosen for (some versions of) … Read more