Lenna's History
Lenna's History
Have you noticed that the text starts with STX and ends with ETX and EOT?
- Yharaskrik
- Posts: 31
- Joined: Wed Nov 05, 2008 11:44 am
- Location: Germany
The fiddliest part was to find a text such that the sum of its ascii codes equals the number of pixels of the image. Then the histogram can be adapted using the following Python script:
However, there are some other neat ways to (ab)use a histogram, for instance http://www.stewdio.org/histoface/ and http://www.joshmillard.com/2007/10/04/r ... histogram/.
Code: Select all
import Image
text = '\02Lenna or Lena is the name given to a standard test image originally cropped from a Playboy magazine centerfold picture of Lena Soderberg, a Swedish model who posed nude for the November 1972 issue.\nThe number of copies of the issue sold is your answer!\n\03\04'
color = []
for j,ch in enumerate(text):
color.extend([j] * ord(ch))
image = Image.open("lenna_152x152.png")
pixel = image.load()
width,height = image.size
index = range(width * height)
index.sort(key=lambda i:pixel[divmod(i, width)])
for j,i in enumerate(index):
pixel[divmod(i, width)] = color[j]
image.save('lenna.png')
-
- Forum Admin
- Posts: 496
- Joined: Sat May 28, 2011 9:14 am
- Location: Germany
Good challenge.
Looking at the histogram in IrfanView quickly revealed where the information is hidden.
At first I tried to solve it with Java, but for some reason this attempt failed. I would get around the first third of the text, just before the word "cropped". From then onwards the text became more and more corrupted, and soon completely unreadable. I don't really have a good idea why.
Then I made another attempt with C code using libpng, and this time I got it.
Looking at the histogram in IrfanView quickly revealed where the information is hidden.
At first I tried to solve it with Java, but for some reason this attempt failed. I would get around the first third of the text, just before the word "cropped". From then onwards the text became more and more corrupted, and soon completely unreadable. I don't really have a good idea why.
Then I made another attempt with C code using libpng, and this time I got it.
After hint that histo[ry] could point to histogram I have opened irfan and found I have no histogram modul installed ... so I have used gimp. Than I have codded it in java and finished after cropped as well as AMind*.AMindForeverVoyaging wrote:Good challenge.
Looking at the histogram in IrfanView quickly revealed where the information is hidden.
At first I tried to solve it with Java, but for some reason this attempt failed. I would get around the first third of the text, just before the word "cropped". From then onwards the text became more and more corrupted, and soon completely unreadable. I don't really have a good idea why.
Then I made another attempt with C code using libpng, and this time I got it.
RBG/brightness nontrivial translation is the problem and I have finished it by reading the gimp histogram "by eyes". I was studying Lenna's history before getting the histogram clue but it was not much helpfull in finding the answer.
Using standard image actually lead me to other thinking path ... to find "original in propper size to find differences". So the title probably complicated solving for me.
BTW, I was blind even when looking to the histogram ... I have noticed that one count appears very often (and the the histogram is weird) so I have filtered only pixels with count 32 ... obtaining "random" image. At the second sight the frequency of space and ascii values hit me.
I would consider "Lenna's exposition" or just "Lenna's hist" to be more apropriate name for the challenge.
-
- Forum Admin
- Posts: 496
- Joined: Sat May 28, 2011 9:14 am
- Location: Germany