def _arr2img(ar):
 return Image.frombytes('L', (ar.shape[1], ar.shape[0]), ar.astype(numpy.ubyte).tostring())

def _arr2img ( ar ) : return Image . frombytes ( 'L' , ( ar . shape [ 1 ] , ar . shape [ 0 ] ) , ar . astype ( numpy . ubyte ) . tostring ( ) )
convert numeric array to pil image .