-1

Once I use scipy.misc.toimage with scipy version 1.6.1, it always error with AttributeError: module 'scipy.misc' has no attribute 'toimage'

Regarding the documentation, the attribute like toimage would be used for scipy.misc just only version 1.0.0 until before version 1.2.0

Source: https://docs.scipy.org/doc/scipy-1.2.1/reference/misc.html

Currently, I use python 3.8 and may I know which attribute in scipy version 1.6.1 have the same functional as scipy.misc.toimage from scipy version 1.0.0?

  • Does this answer your question? [AttributeError: module 'scipy.misc' has no attribute 'toimage'](https://stackoverflow.com/questions/57545125/attributeerror-module-scipy-misc-has-no-attribute-toimage) – 9769953 Feb 20 '21 at 17:13

1 Answers1

1

The linked documentation, section toimage states it explicitly:

Use Pillow’s Image.fromarray directly instead.

Install the Pillow package (if not installed already), then use e.g.

from PIL import Image
Image.fromarray(data)

(where data is a NumPy array.)

9769953
  • 10,344
  • 3
  • 26
  • 37