Understand Python Pillow Image Mode: A Completed Guide – Python Pillow Tutorial

By | August 30, 2020

There are some modes in images, the mode of an image defines the type and depth of a pixel in the image. In this tutorial, we will list all modes supported by python pillow.

python pillow image mode examples

All modes supported by python pillow

1 (1-bit pixels, black and white, stored with one pixel per byte), the value is in 0-1.

L (8-bit pixels, black and white), the value is in 0-255.

P (8-bit pixels, mapped to any other mode using a color palette), the value is in 0-255.

RGB (3×8-bit pixels, true color), the value is in [0-255, 0-255, 0-255].

RGBA (4×8-bit pixels, true color with transparency mask), the value is in [0-255, 0-255, 0-255, 0-255]

CMYK (4×8-bit pixels, color separation)

YCbCr (3×8-bit pixels, color video format)

LAB (3×8-bit pixels, the L*a*b color space)

HSV (3×8-bit pixels, Hue, Saturation, Value color space)

I (32-bit signed integer pixels)

F (32-bit floating point pixels)

LA (L with alpha)

PA (P with alpha)

RGBX (true color with padding)

RGBa (true color with premultiplied alpha)

La (L with premultiplied alpha)

I;16 (16-bit unsigned integer pixels)

I;16L (16-bit little endian unsigned integer pixels)

I;16B (16-bit big endian unsigned integer pixels)

I;16N (16-bit native endian unsigned integer pixels)

BGR;15 (15-bit reversed true colour)

BGR;16 (16-bit reversed true colour)

BGR;24 (24-bit reversed true colour)

BGR;32 (32-bit reversed true colour)

We can get and convert image mode in python pillow. Here is the tutorial:

Python Pillow Get and Convert Image Mode: A Beginner Guide – Python Pillow Tutorial

Leave a Reply