"L" mode maps to black and white pixels (and in between). "P" mode maps with a color palette. You can convert image to one of these modes.
from PIL import Image
im = Image.open("im.jpg")
im_l = im.convert('L')
im_p = im.convert('P')
im.show()
im_l.show()
im_p.show()