mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 02:16:19 +03:00
Use numpy.array with dtype
Thank you @radarhere. Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
73f6cf22f3
commit
8d1b433c76
|
@ -700,10 +700,7 @@ class Image:
|
|||
class ArrayData:
|
||||
__array_interface__ = new
|
||||
|
||||
arr = np.array(ArrayData())
|
||||
if dtype is not None:
|
||||
arr = arr.astype(dtype)
|
||||
return arr
|
||||
return np.array(ArrayData(), dtype)
|
||||
|
||||
def __getstate__(self):
|
||||
return [self.info, self.mode, self.size, self.getpalette(), self.tobytes()]
|
||||
|
|
Loading…
Reference in New Issue
Block a user