Say that I have two images concatenate, so that the whole image is shape (256,512) like this: [X|X]
I want to be able to do this:
from PIL import Image
both_image = Image.open(path)
img_left = both_image[:,:256]
img_right = both_image[:,256:]
but *** TypeError: 'PngImageFile' object is not subscriptable
To fix it, im writing: both_image = np.array(Image.open(path)) and using Image.fromarray() at the end
Is there a better way to do so, without going from Image type to numpy array back and forth?