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?


回答1:


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.



来源:https://stackoverflow.com/questions/59798243/does-pil-imageenhance-library-supports-16-bit-jpg-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!