code: def reveal(input_image: Union[str, IO[bytes]], encoding="UTF-8"):
      
      img = tools.open_image(input_image)
      width, height = img.size
      buff, count = 0, 0
      bitab = []
      limit = None
      for row in range(height):
          for col in range(width):
  
              # pixel = [r, g, b] or [r,g,b,a]
              pixel = img.getpixel((col, row))
              if img.mode == "RGBA":
                  pixel = pixel[:3]  # ignore the alpha
              for color in pixel:
                  buff += (color & 1) << (tools.ENCODINGS[encoding] - 1 - count)
                  count += 1
                  if count == tools.ENCODINGS[encoding]:
                      bitab.append(chr(buff))
                      buff, count = 0, 0
                      if bitab[-1] == ":" and limit is None:
                          try:
                              limit = int("".join(bitab[:-1]))
                          except:
                              pass
  
              if len(bitab) - len(str(limit)) - 1 == limit:
                  img.close()
                  return "".join(bitab)[len(str(limit)) + 1 :]
docs: Find a message in an image (with the LSB technique).