diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 98dfec726..6017882aa 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -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()]