1

Ok, so I'm trying to display a file I have in the same directory as my python script (called C.png). The first line just gives me a black bitmap image, while the second line gives me a colored image (like it should). But I cannot figure out why the first Image.open() is just giving me a black bitmap. Am I doing something wrong?

from PIL import Image

Image.open("C.png", "r").show()

Image.new("RGB",(300, 300), (0, 255, 0)).show()

Thanks!

EDIT: It appears that if I use a .jpg file, it works fine... I'm still not sure what is causing this. (A different .jpg file)

James
  • 2,635
  • 5
  • 23
  • 30

0 Answers0