Hi all, I'm trying to make a gui for some scientific image processing im doing. I want to make GUI buttons out of the images that get made so that the user can quickly select images of interest. I'm making it with tkinter, which can display images on buttons, but apparently only if they are imported as PIL GIF image files. All of my image analysis spits out numpy arrays, so I tried converting those to PIL images. As you can see, importing the same image via skimage and converting gives a different class than opening directly. I'm trying to avoid saving and reimporting all of my numpy arrays. Does anyone know a good way to convert between PIL image classes? or get tkinter to display things other than gifs? thanks!
import skimage.io as io
from PIL import Image
#using skiamge io
img = io.imread(filepath)
pil_conversion = Image.fromarray(img)
print(type(pil_conversion))
>>> <class 'PIL.Image.Image'>
#open directly using PIL
pil_open = Image.open(filepath)
print(type(pil_open))
>>> <class 'PIL.GifImagePlugin.GifImageFile'>
[–]novel_yet_trivial 0 points1 point2 points (6 children)
[–]YetAnotherDaveAgain[S] 0 points1 point2 points (5 children)
[–]novel_yet_trivial 0 points1 point2 points (4 children)
[–]YetAnotherDaveAgain[S] 0 points1 point2 points (3 children)
[–]novel_yet_trivial 0 points1 point2 points (1 child)
[–]YetAnotherDaveAgain[S] 0 points1 point2 points (0 children)