Python SolutionsPython Solutions
🖼️
Steganographia
Week 9, 2026
All SolutionsPython Pygame Method | Alexevi | Python Solutions
import pygame
pygame.init()
image = pygame.image.load("message.png")
msg = ""
for y in range(image.get_height()):
for x in range(image.get_width()):
color = image.get_at((x, y))
msg = msg + chr(color.r) + chr(color.g) + chr(color.b)
print(msg)
Python - Pillow Library | BMC | Python Solutions
from PIL import Image
def Decode(imgP):
img = Image.open(imgP).convert("RGB")
pixels = list(img.getdata())
message = ""
for r, g, b in pixels:
message += chr(r) + chr(g) + chr(b)
return message
file = open("ans.txt", 'w')
file.write(Decode("message.png"))
file.close()