Question: If you erase lower two bits in the red value, you can clear space for hiding values 04. for p in getPixels(picture): # Clear out

If you erase lower two bits in the red value, you can clear space for hiding values 0–4.

for p in getPixels(picture):
 # Clear out the red 2xLSB
 r = getRed(p)
 setRed(p,r-(r%4))

If you erase the lower two bits from red, green, and blue, you can save six bits. Six bits can encode 64 values. That’s enough to encode all 27 letters, both upper and lowercase.

(a) Write a function to input a picture and a string. Save each character in the string in a pixel of the picture, by saving it across the least significant two bits in each of red, green, and blue. Can you tell the difference between the original picture and the picture with the encoded text message?

(b) Now write a function to decode the original text.

Step by Step Solution

3.48 Rating (161 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a No its highly unlikely someone could tell a difference between the original and the modifi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction to Computing and Programming in Pytho Questions!