code: def tobinary(images, path, prefix="image", overwrite=False, credentials=None):
      
      from thunder.writers import get_parallel_writer
  
      def tobuffer(kv):
          key, img = kv
          fname = prefix + "-" + "%05d.bin" % int(key)
          return fname, img.copy()
  
      writer = get_parallel_writer(path)(path, overwrite=overwrite, credentials=credentials)
      images.foreach(lambda x: writer.write(tobuffer(x)))
      config(path, list(images.value_shape), images.dtype, overwrite=overwrite)
docs: Write out images as binary files.
  
      See also
      --------
      thunder.data.images.tobinary