parameters: (image)
return_statement: return 'data:image/png;base64,' + data
docstring: Creates an image embedded in HTML base64 format.
docstring_summary: Creates an image embedded in HTML base64 format.
docstring_tokens: Creates an image embedded in HTML base64 format .
function: def embed_image_html(image):
      """Creates an image embedded in HTML base64 format."""
      image_pil = Image.fromarray((255 * image).astype('uint8'))
      image_pil = image_pil.resize((256, 256))
      string_buf = StringIO.StringIO()
      image_pil.save(string_buf, format='png')
      data = string_buf.getvalue().encode('base64').replace('\n', '')
      return 'data:image/png;base64,' + data
function_tokens: def embed_image_html ( image ) : image_pil = Image . fromarray ( ( 255 * image ) . astype ( 'uint8' ) ) image_pil = image_pil . resize ( ( 256 , 256 ) ) string_buf = StringIO . StringIO ( ) image_pil . save ( string_buf , format = 'png' ) data = string_buf . getvalue ( ) . encode ( 'base64' ) . replace ( '\n' , '' ) return 'data:image/png;base64,' + data