Page 1 of 1

Lenna's History

Posted: Thu May 07, 2009 10:48 pm
by teebee
Have you noticed that the text starts with STX and ends with ETX and EOT?

Posted: Fri May 08, 2009 6:33 am
by Yharaskrik
Oh! I see. I thought it was crap :wink:
By the way - nice challenge!

Posted: Sun May 10, 2009 10:54 pm
by teebee
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:

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')
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/.

Posted: Thu Nov 18, 2010 8:35 am
by wrtlprnft
Very nice challenge indeed!

The title made it kind of easy, though, thanks :-)

Posted: Wed Jun 08, 2016 3:07 pm
by AMindForeverVoyaging
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.

Posted: Fri Jun 17, 2016 4:06 pm
by Hippo
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.
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*.
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.

Posted: Fri Sep 02, 2016 8:44 pm
by teebee
Hippo wrote:I would consider "Lenna's exposition" or just "Lenna's hist" to be more apropriate name for the challenge.
Actually, the title was meant to be short for "Lenna's Hi(stogram) Story".

Posted: Sat Sep 03, 2016 11:38 am
by AMindForeverVoyaging
Yay, teebee is back! :)