import sys import Image # allows us to create image import ImageDraw # more fancy stuff #hidden message stored in message message = "secretsarefun" #color.png can be changed to open a different image to conceal a message image = Image.open("color.png") width, height = image.size #Hiding the message in the image wpad = width / len(message) hpad = height / len(message) x = 0 y = 0 for i in range(0, len(message)): red, green, blue = image.getpixel((x,y)) hiddenChar = ord(message[i]) #STUDENTS START CODING HERE #placing the hidden message character into the pixel #STUDENTS STOP CODING HERE image.putpixel((x,y), (red, green, blue)) x += wpad y += hpad #retrieing the hidden message hiddenMessage = "" x = 0 y = 0 for i in range(0,len(message)): red, green, blue = image.getpixel((x,y)) #STUDENTS START CODING HERE #retriving the message from the pixel #STUDENTS STOP CODING HERE x += wpad y += hpad print hiddenMessage # output image.save("colorhidden.png")