I need to read in a message from the user, iterate across each bit of the message and overwrite the least significant image bit with each message bit.
I currently have a program that iterates over each image pixel and just rewrites out the image.
So how can i read the least significant image bit and how can i get each message bit.
This is for a grey scale image using python 3.x
from PIL import Image
import numpy as np
import bitget
import scipy.misc as smp
im = Image.open("catBlack.png") #Can be many different formats.
pix = im.load()
print (im.size )#Get the width and hight of the image for iterating over
print (pix[1,1]) #Get the RGBA Value of the a pixel of an image
#pix[x,y] = value # Set the RGBA Value of the image (tup
data = np.zeros( (im.size[0],im.size[1],2), dtype=np.uint8 )
for i in range (im.size[0]):
for j in range (im.size[1]):
print (i,j)
data[i,j] = pix[i,j]
im = Image.fromarray(data)
im.save("GreyCat.png")
Also , how would i decode out this message
Cheers for the help