I'm working on a small little app to conceal a file inside a Bitmap. I may not finish it though, cos i'm very very busy with coursework and other things. So if anyone likes the idea and wants to help out by doing large lumps of it for me, they're welcome (ask permission first tho, lol).
The application will only work with files that meet the following criteria:
BMP Requirements
---File Type: BM (basically, a standard
Bitmap file. Not an
Icon, or a Cursor.
The first two bytes
must read 'BM'. )
---Colour Depth: 24 bits (possibly also 32 bits)
---Compression: None.
---Image Size: Must be large enough to hide
the original file. We'll get
to this later.
The app will also feature 8 quality settings. The higher the quality, the bigger the image must be.
Quality Settings
Quality Result
1 Lossless (Alterations to the image will
be invisible to the naked eye)
2 Lossless (Alterations should still be
almost invisible)
3 Quality (Some small variation in shade)
4 Medium (More variation)
5 Low (Variation will probably be
high)
6 Very low (Original image may be hard to
discern)
7 Almost Lost (Original image will be almost
idistinguishable)
8 Lost (Original image will be gone)
The effect of the blend basically causes a kind of noise to appear in the image. The lower the quality, the more 'noisy' the image may appear.
How it works
It works by taking every byte of each pixel (there are three bytes per pixel, one for Red, Green and Blue) and removing some bits at the end. The number of bits it removes is based on the the quality setting (so 1 removes 1 bit per byte; 2 removes 2 bits per byte; and so on).
It then replaces the lost bit(s) with bits from the original file. Eg:
Original Pixel Colour:
R 00000000 = 000
G 00000000 = 000
B 11111111 = 255
Byte to Blend:
11 01 01 10 = 214 (at quality #2, this will take 4 bytes)
Colour with bits stripped off (where quality = 2)
R 00000000 = 000
G 00000000 = 000
B 11111100 = 252
Result once blended
R 00000011 = 003
G 00000001 = 001
B 11111101 = 253
This leaves a remainder of two bits, which would
be blended with the next byte in the file. But
hopefully you can see how it affects the image
quality. If you open paint and make two coloured
boxes, one of 0,0,255 and one of 3,1,253, I hope
you'll see that there's barely any difference.
As I mentioned earlier, there are certain size restraints. The BMP file must have enough pixels (height X width) in it to hold all the bytes of the other file.
The application itself will tell you how many pixels you need, but to give a basic example, here are a list of image sizes necessary to hold a 10,000 byte file.
26,667 sounds a lot, but it's only a 164x163 picture.
This would be designed to work mainly at high qualities with small-ish files (such as ini files, game saves, array files, etc. Not huge many-megabyte files).
Anyway, my time's run out, so I'll leave you to comment as you wish. I hope at least someone's interested in this. I always thought it was quite cool to be able to blend a file with a bitmap and not be able to see any difference to the eye or the filesize...
Dines this idea rules. Hiding files in bmp images is a really cool idea, and for sneaky artists like me it would be a really neat way of getting information around. I have no idea how to make a program like this but if I did I would gladly help. I hope you do finish this at some point, I'd be willing to pay for a decent app that did that.
Well it seems the perfect place to hide something!
People could be wondering for weeks where the game saves are stored, only to find that they're embedded in the title screen. A 640x480 game has 307,200 pixels on screen. You could store a 230k zip file full of gamesaves in that (at just 2x quality!).
The only three things you need to pull this off are:
1. Binary Object
2. Base Converter Object
3. A file explaining BMP format
Sorry to resurrect a long-dead post, but just an update for any interested. I think I've just generated the first working blend. I'm about to check that it can actually be reversed, lol, because I haven't built the reverser, but it seems promising.
The file can still be read as a bmp anyway, which is a turn up for the books. I expected to have tons of trouble making it re-loadable in paint, but Binary Object's stuck to the spec quite well. Which is unusual.
I'll see if I can post some before and afters to show the compression ratios.
191 / 9999 * 7 + 191 * 7
Assault Andy Administrator
I make other people create vaporware
None
This is what the bmp file looks like without anything blended
1-bit compression
Using 1-bit compression, 384 bytes of ascii text are blended with this picture. Regardless of how much you zoom in, you won't notice the noise created.
2-bit compression
768 bytes of text. Again, to the naked eye (even at high levels of zoom), there is no visible loss in quality.
3-bit compression
1,152 bytes. At a standard screen resolution there is still no change, but zooming in will start to show slight dithering.
4-bit compression
1,536 bytes. Dithering is starting to notice even at a normal resolution (1024x76. With zoom, the noise is getting kinda ugly.
5-bit compression
1,920 bytes. Ugly. The picture says it all. We're actually losing brightness now. The whole image is less luminant than the ones before it, and we're losing contrast.
6-bit compression
2,304 bytes. Worse. Contrast and luminance have suffered more. Patches of similar colours are becoming hard to distinguish from each other.
7-bit compression
2,688 bytes. Hideous. Colours are bleeding into each other. The blues of the background are totally mixed.
8-bit compression
3,072 bytes. Maximum file blend with minimum quality. The original image is lost. What you see here is made entirely from the binary data of the original file. Apart from the header info in the BMP, the original image is gone forever.
Practicalities
Anything between 1 and 3 are the best blending ratios to use. A 640x480 picture at 3-bit quality would hold a 345k zip file.
PNG files are another lossless format. These can be combined with this system, so that a bmp file doesn't need to be as big as it normally would be.
Radix: Yeah, although I think Stegano uses a different system since it can embed files in JPEG. That wouldn't be possible with my method because JPEG is lossy. I can't imagine how they watermark a jpeg, lol. I read their patents and it sounds complicated
Keaton: At the moment those contain text, but you can shove anything in them. So long as the file size is small enough, those could be zip files. I used text for the examples because it's easier to change the length.
hey, thats a good idea for preventing kids from looking at p0rn.
Adults who want to view porn must have a converter to look at it, Kids who access a p0rn site will only see a picture of a bunny while the real picture is hidden in it.