This is how PICO-8 game cartridges are contained in a small PNG of the game itself!<p><a href="https://www.lexaloffle.com/pico-8.php" rel="nofollow">https://www.lexaloffle.com/pico-8.php</a><p><a href="https://robertovaccari.com/blog/2021_01_03_stegano_pico8/" rel="nofollow">https://robertovaccari.com/blog/2021_01_03_stegano_pico8/</a>
An expedient way to hide another photo (or any data) in another photo is to simply append it to the original photo. It's certainly not as secure as OP's method, but it has the advantage of not requiring any third party app, just standard command line tools.<p>Example: you have duck.jpg (21500 bytes) and you want to hide flower.jpg (37733 bytes). Do this to create a larger file (59233 bytes):<p><pre><code> cat duck.jpeg flower.jpeg > bigger-duck-file.jpg
</code></pre>
Anyone looking at bigger-duck-file.jpg will see the duck. Every image viewing program I tried displays the duck and none of them complain about the extra bytes (the hidden image) at the end of the file.<p>The recipient can extract the hidden file as follows:<p><pre><code> tail -c 37733 bigger-duck-file.jpg > flower.jpg
</code></pre>
You would have to tell the recipient the size of the hidden file by some other means. But there might be a simple command-line way to determine where the image data for duck.jpg really ends in the bigger file, so maybe you wouldn't need that step.
Steganography is a very exciting topic and is not limited to image data but can also be applied to, e.g., audio data.<p>I’ve done something similar in the past and embedded Merkle tree nodes in an image to allow partial integrity validation. It was a fun little project:<p><a href="https://github.com/dennis-tra/image-stego" rel="nofollow">https://github.com/dennis-tra/image-stego</a>
Check out <a href="https://en.m.wikipedia.org/wiki/Steganography" rel="nofollow">https://en.m.wikipedia.org/wiki/Steganography</a> if this is your thing
Videos provide much more space to hide data in than your typical images do.<p>I've always wondered if there was some way that hidden information inside videos could be designed to survive the re-encoding that youtube does when you upload a video.<p>Has anyone investigated this?
Hmm.<p>So combined with Apple's CSAM scanner, you can put CSAM inside a cat photo... And then anonymously leak the cat photo and tool to show it's CSAM. And then the CSAM scanner will flag the hash and alert the police of the user.<p>And the target victim would never know.
I had another idea for steganography in Jpegs specifically. So in Jpeg there is something called the Quantization Table that's responsible for weighting all the AC values in each 8x8 block. When you encode, you divide the DCT values by the corresponding DQT value so a large quantization value has a greater chance of reducing the DCT to 0, allowing us to truncate the high frequencies (we want this). To decode we just multiply by the corresponding quantization value and run the inverse DCT.<p>But nothing prevents us from putting 0s in the Quantization table. And any pixel put in those values wouldn't contributed to the rasterized image. So we can cut off some of the high frequency bins entirely and then store whatever in them.
Ages ago I made a tool that does a similar method (rewrite the least-significant N bits of a pixel in the cover image with the most-significant N bits of the corresponding pixel of the hidden image). In my tool N is configurable.<p>The main pitfall is that it doesn't work very well if the output is saved as a JPEG because of the compression.<p>I think OP's idea of encoding <i>all</i> of the bits of the hidden image, by using a cover image with more pixels, is a good improvement: you get no loss of quality in the hidden image, and you vastly reduce the loss of quality in the cover image.<p><a href="https://incoherency.co.uk/image-steganography/" rel="nofollow">https://incoherency.co.uk/image-steganography/</a>
>Have you ever thought of hiding a photo inside another photo?<p>No? Is there any use for this besides people sharing Child Sexual Abuse imagery without being detected?
Would it be feasible to have a machine readable image like a QR code as the obscured image, so if people took a photo of a poster some metadata about the poster could be exposed to the camera app to then be passed onto the user?<p>Or does this technique rely on having access to the original digital image, and too much information is lost over the analog gap?
I remember seeing an image a long time ago that revealed a different image when you highlighted it. But I could never find any references to the technique since then. Does anyone else remember something like this?
Steganography is so exciting, my first exposure was on 4chan back in 2006, you could use image hosting sites to hide and secretly host tons of things. SOF/EOF and such to look for that and more... :)
The next step would be to hide an animation within another, in the APNG format. But I ignore if there is any compression that would make this impossible.