def has_transparency(image: Image) -> bool:
    if (image.mode == 'P'):
        transparent = image.info.get('transparency', (- 1))
        for (_, index) in image.getcolors():
            if (index == transparent):
                return True
    elif (image.mode == 'RGBA'):
        extrema = image.getextrema()
        if (extrema[3][0] < 255):
            return True
    return False
def has_transparency(image: Image) -> bool:
    if (image.mode == 'P'):
        transparent = image.info.get('transparency', (- 1))
        for (_, index) in image.getcolors():
            if (index == transparent):
                return True
    elif (image.mode == 'RGBA'):
        extrema = image.getextrema()
        if (extrema[3][0] < 255):
            return True
    return False