15

I am trying to blend two images together but I keep getting an error that one of the images in in the wrong mode. I tried to convert this image but every mode I have tried just makes the entire image white. Is there a way in Python with the PIL module to find out what the current image mode is?

Image.blend(img ,im ,0.05)

Error message: ValueError: image has wrong mode

Foon
  • 6,148
  • 11
  • 40
  • 42
Chidwack
  • 357
  • 1
  • 3
  • 9

1 Answers1

23

See the Image Attributes in the documentation:

Image.mode: str

Image mode. This is a string specifying the pixel format used by the image. Typical values are '1', 'L', 'RGB', or 'CMYK'. See Modes for a full list.

The Image.convert method creates, from an existing image, a new Image with a given mode.

Peter Wood
  • 23,859
  • 5
  • 60
  • 99