def is_transparent(image):
 if (not isinstance(image, Image.Image)):
  return False
 return ((image.mode in ('RGBA', 'LA')) or ((image.mode == 'P') and ('transparency' in image.info)))

def is_transparent ( image ) : if ( not isinstance ( image , Image . Image ) ) : return False return ( ( image . mode in ( 'RGBA' , 'LA' ) ) or ( ( image . mode == 'P' ) and ( 'transparency' in image . info ) ) )
check to see if an image is transparent .