Hi,



 Wesley_Neill:

pic = pic.astype(int)


Solution:
pic = pic.astype(np.uint8)

Reason:
Python int dtype is 64bits so it does not work on PIL images. If you scroll down the documentation of ToPILImage, you will find a link to all modes that PIL supports. https://pillow.readthedocs.io/en/latest/handbook/concepts.html#modes 21
In this page, you can find that different dtypes correspond to different modes, so if you have a 0-255 image you need to use 8bit dtypes.
I think based on first issue, second one is also can be considered as solved, right?
Bests