Why is my getbands returning 'L'?

Asked

Viewed 20 times

2

I am working with images and am filtering images with transparency. I am using the function getbands() Pillow. But this image is returning : ('L',) while I just waited: ('R','G', 'B') and ('R','G', 'B', 'A').

What exactly is an image L? I searched a lot of places but I couldn’t figure out what it meant.

inserir a descrição da imagem aqui

1 answer

5


L is "Level", a grey channel only.

This sort of thing is merely a matter of studying the library manual used, probably the PIL/Pillow in the case.

Modes (which therefore define the most common bands) are these:

  • 1 (1-bit per pixel, white and black)
  • L (8-bit per pixel, grayscale)
  • P (8-bit per pixel, referencing a color palette)
  • RGB (3x8-bit per pixel, one channel of each color)
  • RGBA (4x8-bit per pixel, same as before + transparency)
  • CMYK (4x8-bit per pixel in pigment colors)
  • YCbCr (3x8-bit per pixel, common video format, based on color deviation)
  • LAB (3x8-bit per pixel, another format based on luminance and offset )
  • HSV (3x8-bit per pixel, hue, saturation and value)

Handbook: http://pillow.readthedocs.io/en/stable/handbook/concepts.html

Browser other questions tagged

You are not signed in. Login or sign up in order to post.