mode_to_bpp = {'1': 1, 'L': 8, 'P': 8, 'RGB': 24, 'RGBA': 32, 'CMYK': 32,
    'YCbCr': 24, 'I': 32, 'F': 32}
data = Image.open('file.jpg')
bpp = mode_to_bpp[data.mode]
How can I get the depth of a jpg file?