Stereograms – I love them!

I can still remember the first time I managed to see a sterogram properly. I’d bought two posters – one f Bugs Bunny and one of and eagle against a mountainous landscape – or at least thats what they claimed they were. All I could see was a lot of coloured dots – no pictures.
Those posters were hung up on my work office wall and to my total disgust, various work collegues would casually stroll up, look at the picture and take great delight in telling me how amazing it looked. But could I see them – could I heck.
However, after about 3 months I wandered over, and looked at one slightly differently and it just suddenly came into focus and I was totally blown away. They still fascinate me and over time, I’ve http://www.buyambienmed.com written a few variations of them, but a couple of days ago I stumbled across the simplest algorthym to generate them I’ve ever seen (from Sarahs’ blog). I’ve shown the relevant bit of code below (C#) just in case I lose the bookmark or the page goes offline.


void RDS(Bitmap bitmap,int stripWidth)
{
    Random rnd = new Random();
    int rndDotColour;
    float scaling;
    int width=bitmap.Width;
    int height=bitmap.Height;

    // This makes sure full white (high points are white and
    // have a value of 255) are always 1/5th the width of
    // the image strip.
    scaling=((float)stripWidth/(float)5)/(float)255; 

    //Draw the random strip
    for(int y=0;y

Call it using something like:

Bitmap bitmap = new Bitmap("c:/shark.png"); // http://rdc.untamed.co.uk/rds/shark.png
RDS(bitmap,90);

Now thats pretty amazing. I've also started to make it into an iPhone application (why not) and the plan is to be able to draw and create your own. Why? why not I say. Note, its somewhat more complicated on the iPhone as bitmap drawing is pretty much non-existant, but its working.

Slight update - its now working with images as well as dots (Single-Image Stereogram)

Downside - its very slow (36 secs on the iPhone to generate an image). Booo - not the iPhones fault here note - most certainly my lack of Cocoa drawing.

As always, screenshots once the NDA is lifted.

iPhone Stuff

Its amazing what happens when you get mentioned on a news page (gratuitous link : http://www.tuaw.com/2008/06/22/iphone-app-news-roundup-june-22-2008/). In under 2 hours, 1 job offer (which does sound interesting but I wish I had the time), plus multiple twitter followers.

Just can’t wait until the NDA is lifted so I can put some screenshots up.

iPhone Apps

Well, Cube Runner and iCave are pretty much complete now. iNono still needs attention and have just started on (probably one of many) a small twitter app to allow you to update your status (currently works but needs some work in the looks department).

Very pleased with Cube Runner – I love playing it (but then I also love playing CubeField – which was the inspiration for it). Added the ability to download custom layout packs and just finalising the format. The plan is to allow users to be able to design their own layouts. This does add a bit of complexity and also some sadness though. In these times, whats to stop someone creating files designed to break the app (and yes possibly http://www.eta-i.org/tramadol.html causing some form of exploit)? Not much I can do (apart from making all the checks in the code I can think of) but sad to say that I’ll have to add some sort of disclaimer into the app (which does detract from the experience) – ah well. I’m sure people would prefer that to not being able to add extra bits.

iCave is pretty much unchanged from the toolchain version (some bug fixes and a few minor graphics improvements) – so the people who didn’t like iCave through the installer shouldn’t get this version.

But I’m enjoying developing for the iPhone/Touch. Is been a huge learning curve but a good challenge