Img2Img hider

tuohirv 101 May 12, 2010 at 14:00


Since I am spending my holiday currently I finally have time for my own tests. Few days ago I got an idea about hiding images inside other images (I thought about some old paintings that I have saw which achieved similar effect) and wrote a software trying to do that. Here is a collection of images from my tests with the software. The images have been cut from MUCH larger original images (the background images must be large to get enough possibilities) but no other hand-manipulation has been made.

Basically I just give the software a background-image and another image which should be hidden. The software seeks through the images and tries to find a best possible position for the image to be blit. The actual blitting uses some interesting techniques as well; it calculates the errors between target/source colors and manipulates the final pixel according to that (lightness, color, local-contrast, etc. )… I’m not sure what this technique is called, maybe it has no name. I just call it “natural blend” :)

What do you think?

11 Replies

Please log in or register to post a reply.

tobeythorn 101 May 12, 2010 at 14:24

i think that is really cool. in the two middle and the upper right images, the blending is quite natural looking and a bit creepy. good job.

vrnunes 102 May 12, 2010 at 15:29

The two right upper images are very nicely blended. They have depth and volume, merging perfectly with the environment. Great results, indeed.

The other images could be reproduced in seconds with photoshop.

TheNut 179 May 12, 2010 at 18:48

There were a couple games I use to play where you are given a task to find several items within an image. Some of them are so well blended that you could spend minutes trying to find it. Having an algorithm to automate that would be interesting. Do you brute force the possibilities or is there something more intelligent?

tuohirv 101 May 13, 2010 at 06:21

Thanks for feedback. I’m currently visiting some relatives and can’t work with my main computer, i don’t know if i can improve the program before weekend… The main function of the program is to find perfect spot for other image to be blended, i understand that once the spot is selected, … any graphic-guy can do the blending better manually. I couldn’t do that myseld ;) … Before i left yesterday, i took some pictures from my neighborhood and used them as a background with improved place-select/blend algorithm.

I managed to upload some fullscale images to bayimg. There you can see the size of the originals (the ones i used for these first images, are even larger).

// cutted

// full scale’

And TheNut, i indeed use “brute-force” to seek minimum error within the image. However, I use some performance-tricks; the resolution of the image to be hidden determines “size_div”, which is used to downscale both images before the first stage. Typically the small-scale is 10-16 times smaller in both resolution components. This small-scale check determines the area of full-resolution scan which fine-tunes the position for the blit.

When i return to home, i’m planning to add rotation to the image. This gives exponentially more good possibilities to the blit.

Thanks for the feedback again :)


Nema 101 May 14, 2010 at 06:42

nice & innovative! respect!

tuohirv 101 May 14, 2010 at 07:20

Quick update, .. I finished adding the rotation-support for the system. With few fast tests, looks good. Also, i got to take some dancing pictures with my own copyright and I’m planning to use them as soon as i get back home (this night).

// cutted version

I really have some difficulties programming with my wifes laptop and i will wait until i get to use my own equipment before testing more :)

Btw. Interestingly, about the rotation, it scannes 16 different angles but only with low-resolution-versions. It didn’t slow down the operation nearly as much as i thought it would… Hmmm… maybe scaling wouldnt be bad idea either ;)

tuohirv 101 May 16, 2010 at 15:44

Here are some more test with rotation… I’m currently improving the performance (and adding more variables than angle .. ). I got bored uploading the images one by one (for some reason, the’s archive upload didn’t work (returned empty page every time)) so i used flicr for now.

Anyone has any ideas what imagehosting service i should use?

tuohirv 101 May 19, 2010 at 07:00

I finally managed to record a video … Oh my there were difficulties trying to get non-standard-resolution OGV to work with youtube :) … Well, it works now… Check it, i think it’s really cool.

You should use 720p-resolution when watching..

rouncer 103 May 19, 2010 at 09:03

its real spinny man, its like im seeing things. :)
this is the kinda thing i like to code for fun!

tuohirv 101 May 19, 2010 at 09:08

Thanks Rouncer! .. This is the kind of thing i like to do also in my spare-time. Small, compact, minimum additional decencies, results something everyone can understand (not just the programmers) … We should always remember why we are programmers in the first place; for fun. At the beginning, now and forever! ;)

roel 101 Jul 16, 2010 at 12:05

I just saw this video:
That isn’t you, is it?