Does PIL ImageEnhance library supports 16 bit JPG images

久未见 提交于 2021-01-28 06:20:30


I am trying to save and display 16 bit JPG image. but getting error like

image has wrong mode .

If Supported, then what will be the mode?


Check this

The mode (this is a string specifying the pixel format used by the image) of an image defines the type and depth of a pixel in the image. The current Python Imaging Library release only supports the following standard modes:

1 (1-bit pixels, black and white, stored with one pixel per byte)

L (8-bit pixels, black and white)

P (8-bit pixels, mapped to any other mode using a colour palette)

RGB (3x8-bit pixels, true colour)

RGBA (4x8-bit pixels, true colour with transparency mask)

CMYK (4x8-bit pixels, colour separation)

YCbCr (3x8-bit pixels, colour video format)

I (32-bit signed integer pixels)

F (32-bit floating-point pixels)

This may be the reason you are getting the above error. The Image.convert method creates, from an existing image, a new image with a given mode. To know more about image attributes check the link and about full concept check the link.

Hope this helps you.