I am doing some image editing with the PIL libary. The point is, that I don't want to save the image each time on my HDD to view it in Explorer. Is there a small module that simply enables me to set up a window and display the image?
Try setting the image format attribute explicitly to . png (i.e. im. format = "PNG" ) before the im. show() call.
PIL has no native way of opening an image in full screen. And it makes sense that it can't. What PIL does is it simply opens your file in the default . bmp file viewing program (commonly, Windows Photos on Windows [although this is Windows version dependent]).
From near the beginning of the PIL Tutorial:
Once you have an instance of the Image class, you can use the methods defined by this class to process and manipulate the image. For example, let's display the image we just loaded:
>>> im.show()
Update:
Nowadays theImage.show()
method is formally documented in the Pillow fork of PIL along with an explanation of how it's implemented on different OSs.
I tested this and it works fine for me:
from PIL import Image im = Image.open('image.jpg') im.show()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With