code: def hide(
      input_image_file,
      img_enc,
      secret_message=None,
      secret_file=None,
      img_format=None,
  ):
      
      from zlib import compress
      from base64 import b64encode
  
      if secret_file != None:
          with open(secret_file, "r") as f:
              secret_message = f.read()
  
      try:
          text = compress(b64encode(bytes(secret_message, "utf-8")))
      except:
          text = compress(b64encode(secret_message))
  
      img = tools.open_image(input_image_file)
  
      if img_format is None:
          img_format = img.format
  
      if "exif" in img.info:
          exif_dict = piexif.load(img.info["exif"])
      else:
          exif_dict = {}
          exif_dict["0th"] = {}
      exif_dict["0th"][piexif.ImageIFD.ImageDescription] = text
      exif_bytes = piexif.dump(exif_dict)
      img.save(img_enc, format=img_format, exif=exif_bytes)
      img.close()
      return img
docs: Hide a message (string) in an image.