code: def write_tiff_image(filename, image, compress=False):
      
      if compress:
          return tiff.imsave(filename, image, compress='lzma')  # loseless compression, works very well on masks
      return tiff.imsave(filename, image)
docs: Write image data to TIFF file
  
      :param filename: name of file to write data to
      :type filename: str
      :param image: image data to write to file
      :type image: numpy array
      :param compress: whether to compress data. If ``True``, lzma compression is used. Default is ``False``
      :type compress: bool