Image>Adjustments>Levels = WTF?
September 30, 2007 9:36 PM   Subscribe

The Histogram As The Image. An interesting (but probably mostly useless) spin on steganography.
posted by melorama (20 comments total) 8 users marked this as a favorite
I read this whole article and I still don't quite get it. I'm used to the basic statistical uses of histograms, but not whatever he is doing with it. Geeks seem to be having a collective orgasm over it though, so I guess I'm jut missing out.
posted by arcticwoman at 9:39 PM on September 30, 2007

Histograms are commonly represented as bar graphs with a bar for each bin. In the article, he created a custom image that has a histogram that, represented in the common way, resembles the NYC skyline.
Any black and white image could be embedded in a image that way, as long as the image had no black pixels above white pixels.

I think it's neat.
posted by demiurge at 9:44 PM on September 30, 2007

arcticwoman: it's the same thing as the histograms you're used to in statistics. Each shade of gray in the original image has its own numerical value. Each vertical line in the histogram represents the amount of that value in the original image. In this case, the histogram itself forms a picture. Possibly what's tripping you up is that in statistics, you're not supposed to manipulate the data in order to get certain results. He manipulated the image (i.e., the pixel data) in order to create this histogram.
posted by desjardins at 9:51 PM on September 30, 2007

As someone who does a lot of work with images and their histograms, that was pretty cool.
posted by pombe at 10:22 PM on September 30, 2007

I really enjoyed this when I saw it the other day. It's kind of problematic and toyish as steganography goes—the dependence on a specific width and height of histogram to preserve the information is a biggie—but it's very cool.

It occurred to me that it shouldn't in fact be that hard to create an arbitrary image that produces (with the problems alluded to above, granted) an arbitrary pre-selected historgram "skyline". You could set it up to take an input image and an input target histogram and generate and output image with said historgram (as this guy was sort of suggesting):

Take your input image. Take the histogram of that. Compare to the target histogram. Do stepwise readjustment of the input image to transfer pixels in a monotonic fashion toward the peaks and valleys of the target histogram. What you would end up with be the same as a (likely fairly aggresively) "levels"-altered version of the original input image: various shades blown up or down in the luminance scale, but all the darker/lighter relationships between portions of the image palette preserved.

Wine, and the desire to get to bed, prevent me from explaining that more coherently, but the point is this: someone clever could spend a weekend making this (a) automatic, and (b) really fucking awesome. The gradient is a nice proof of concept, but it's tinkertoys.
posted by cortex at 10:35 PM on September 30, 2007

someone clever could spend a weekend making this (a) automatic, and (b) really fucking awesome.

That sounds great in theory, but I'm having trouble thinking up any intereting images one could create under the contraints of a histogram (no black above white). I mean, if you can't create pac man, how awesome can it really be?
posted by scottreynen at 11:04 PM on September 30, 2007

That is really cool; I agree that it seems pretty useless for now, but someone somewhere will come up with a good use for it.
posted by TedW at 5:11 AM on October 1, 2007

It's a toy hack.

Mind you, it's a *really cool* toy hack....
posted by eriko at 5:13 AM on October 1, 2007

That is pretty damned awesome. It's barely at the proof of concept level, yes, but I wonder if anyone (say, in the bowels of the NSA) has ever thought of this before.

You'd need some mighty processing power to make the image but there is probably a way to take an input image (family snapshot) and a given blob of information (coded message, missile plans, etc.) and hide the latter in the former with only partial visibility (say, looks like the film was accidentally exposed to light). I don't know that it would be more efficient than regular bitwise steganography, though. It might be easier to conceal.

Of course, if you have a steganographic viewer, anyone with physical access to your equipment will be able to figure out what you're up to. That's the achilles heel of many types of encryption.
posted by dhartung at 5:14 AM on October 1, 2007

Does what it says on the tin: interesting and useless.

Bravo, sir!

posted by LordSludge at 6:23 AM on October 1, 2007

An interesting use would be embedding bar codes into the histogram representing the real data that you want to transmit. Albeit, a small data channel, you could still possibly transmit messages using lots of images... plus, images done using this method could be highly compressible.
posted by id at 8:40 AM on October 1, 2007

Linked in the comments to The Histogram As Image, The Aphex Face uncovers images encoded in music CD soundtracks (and mentions Spectrogram audio analysis and Coagula image-sound synthesizer apps).
posted by cenoxo at 9:23 AM on October 1, 2007

That sounds great in theory, but I'm having trouble thinking up any interesting images one could create under the constraints of a histogram (no black above white). I mean, if you can't create pac man, how awesome can it really be?

Hold on, it's not quite that bad. Any image that can be formed from three contiguous primary coloured polygons on the sides of the image will do for a histogram of a true-colour image. The difficulty lays in creating a meaningful image from the histogram - piggybacking on another image is probably the only viable solution.
posted by PuGZ at 6:40 AM on October 2, 2007

But then you still can't have any no-red above red or no-blue under blue etcetera, right?
posted by goodnewsfortheinsane at 8:05 AM on October 2, 2007

Another way to consider creating complex images is to eschew the coloredness of your separate RGB histogram channels and instead treat them as an XOR bitmask or something similar; wherever there's either one or three layers, paint black, and whever there's zero or two layers, white. It'd give you a still-very-constrained toolset, but you could get some extra oomph out of it.
posted by cortex at 8:14 AM on October 2, 2007

gnfti: Yeah, it is the same short-coming but it allows *some* wiggle-room.

In a fit of boredom during the 90 minutes since my last post, I decided to throw together a small script to do what cortex was talking about.

The script takes an arbitrary histogram (I chose to take the histogram from an existing photo rather than create one by hand, but that would work too.) It then takes a base image and modifies it until a final image is created that has an identical histogram to the arbitrary one chosen earlier.

As it was a quick job (My attention span is even less than that of the typical 18 year old =P), one can see that the top of the image is more heavily modified than the bottom as I do it linearly. I'll refine the script a bit more and spread out the modifications so they are not quite so pronounced.

Thanks for the interesting link, melorama and thanks to cortex for wasting my evening! =D
posted by PuGZ at 8:56 AM on October 2, 2007 [1 favorite]

Neat, PuGZ! Where I think the tricky part comes in (and why I'm doing a lot of talking but no actual coding so far) is in choosing which pixels to change to keep the image from looking all whacked out like our after is—more levels adjustment across the image and less glitch-plugin solarization effect, natch.
posted by cortex at 9:09 AM on October 2, 2007

Thanks. I've improved it ever so slightly. (You need to flip back and forth between the old image and this one to see the difference) Most entertaining procrastination ever. =P

You're right in your assessment, I think. I'll keep playing around with it when I get back later this evening.
posted by PuGZ at 7:36 PM on October 2, 2007

I have so totally fucking gotten this working. Margin too small to contain, blah blah blah—more later when I've got some bugs ironed out.
posted by cortex at 2:07 PM on October 4, 2007

Here's the writeup. It works. It lives. I can stop thinking about goddam histogram hashes now.

And the money shot: a picture with a self-similar histogram. Woo!
posted by cortex at 6:04 PM on October 4, 2007

« Older intricate silhouettes   |   The Dawn of the Space Age Newer »

This thread has been archived and is closed to new comments