Share your repls and programming experiences

← Back to all posts
Image Message Encoder
lilpeen (221)

Image Message Encoder

A simple program that slightly modifies the colors of an image to store a message.

How it works

First, if the message is not at max length, spaces are added to the end until it reaches max length. The message is then converted to binary.

Each pixel's color can be represented as an RGB value. For example, black would be represented as RGB(0,0,0) and white would be RGB(255,255,255). So, to store binary, a 0 could be an even number, and a 1 could be an odd number. Because a pixel has three different RGB integers, it can store 3 binary digits. If you wanted to store 101 in the color white, the new color would be RGB(255,244,255), and the new color for black would be RGB(1,0,1). Because each pixel is only modified only slightly, and sometimes never at all, it is hard to notice a difference between images.