Lenna's History

Discussion of challenges you have already solved
Post Reply
User avatar
teebee
Posts: 89
Joined: Mon Nov 10, 2008 3:21 pm
Location: Germany

Lenna's History

Post by teebee »

Have you noticed that the text starts with STX and ends with ETX and EOT?
User avatar
Yharaskrik
Posts: 31
Joined: Wed Nov 05, 2008 11:44 am
Location: Germany

Post by Yharaskrik »

Oh! I see. I thought it was crap :wink:
By the way - nice challenge!
User avatar
teebee
Posts: 89
Joined: Mon Nov 10, 2008 3:21 pm
Location: Germany

Post 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/.
wrtlprnft
Posts: 28
Joined: Sun Nov 09, 2008 4:48 pm

Post by wrtlprnft »

Very nice challenge indeed!

The title made it kind of easy, though, thanks :-)
AMindForeverVoyaging
Forum Admin
Posts: 496
Joined: Sat May 28, 2011 9:14 am
Location: Germany

Post 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.
User avatar
Hippo
Posts: 339
Joined: Sat Feb 01, 2014 12:05 am
Location: Praha 5

Post 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.
User avatar
teebee
Posts: 89
Joined: Mon Nov 10, 2008 3:21 pm
Location: Germany

Post 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".
AMindForeverVoyaging
Forum Admin
Posts: 496
Joined: Sat May 28, 2011 9:14 am
Location: Germany

Post by AMindForeverVoyaging »

Yay, teebee is back! :)
Post Reply