

# convert the color image to black and white imageīlackAndWhiteImage = nvert("1")

# Convert the color image to grey scale image Pillow allows using color palettes through the palette parameter of the convert method.ĬolorImage = Image.open("./chameleon.jpg").An image with indexed pixel values or indexed color, will have each of its pixel value referring to an index of an array which is known as color palette.Though today's display devices and software have capability to render images with color depth of 24 bit and 32 bit, in several scenarios it is required to optimize the image representation using indexed pixel values.Convert method supports adaptive palette - a customized palette based on the mostly used colors of the image and a web palette of 216 colors.Convert method of Image class in Pillow supports conversion between RGB, CMYK, grey scale, black & white images and images whose color depth is defined by a color palette.
