def get_pil_channels(pil_mode):
    """Get the number of channels for PIL modes."""
    return {'1': 1, 'L': 1, 'P': 1, 'RGB': 3, 'CMYK': 4, 'YCbCr': 3, 'LAB':
        3, 'HSV': 3, 'I': 1, 'F': 1}.get(pil_mode, 3)
