def imread(fname, dtype=None, img_num=None, **kwargs):
 if isinstance(fname, string_types):
  with open(fname, 'rb') as f:
   im = Image.open(f)
   return pil_to_ndarray(im, dtype=dtype, img_num=img_num)
 else:
  im = Image.open(fname)
  return pil_to_ndarray(im, dtype=dtype, img_num=img_num)

def imread ( fname , dtype = None , img_num = None , ** kwargs ) : if isinstance ( fname , string_types ) : with open ( fname , 'rb' ) as f : im = Image . open ( f ) return pil_to_ndarray ( im , dtype = dtype , img_num = img_num ) else : im = Image . open ( fname ) return pil_to_ndarray ( im , dtype = dtype , img_num = img_num )
return image file in *fname* as :class:numpy .