I have an image sequence and I am trying to run a script on a specific frame. I need to switch to this frame and convert it to an array. However, I am unable to as the frame is an instance <TiffImagePlugin.TiffImageFile image mode=I;16 size=512x512 at 0x104A0C998>
. How can I convert this instance to an array? I have already used numpy.array and it does not work.
Thank you!
prot=Image.open("F23BN.tif")
for frame in ImageSequence.Iterator(dna):
if frame==16:
frame.convert('L')
print frame.mode, frame.format #I checked the format and it is still in the Instance format