def ffmpeg_read_image(filename, with_mask=True):
 if with_mask:
  pix_fmt = 'rgba'
 else:
  pix_fmt = 'rgb24'
 reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt, check_duration=False)
 im = reader.lastread
 del reader
 return im

def ffmpeg_read_image ( filename , with_mask = True ) : if with_mask : pix_fmt = 'rgba' else : pix_fmt = 'rgb24' reader = FFMPEG_VideoReader ( filename , pix_fmt = pix_fmt , check_duration = False ) im = reader . lastread del reader return im
read an image file .