code: def _repr_png_(self):
          
  
          data = ffi.new('l_uint8 **')
          size = ffi.new('size_t *')
  
          err = lept.pixWriteMemPng(data, size, self._cdata, 0)
          if err != 0:
              raise LeptonicaIOError("pixWriteMemPng")
  
          char_data = ffi.cast('char *', data[0])
          return ffi.buffer(char_data, size[0])[:]
docs: iPython display hook
  
          returns png version of image