Image Steganography Techniques Compared: From Wax Tablets to LSB and DCT
Image steganography hides data inside a picture, and there are four main ways to do it: changing the lowest bits of pixel values (LSB), playing with the colour palette of indexed images, tucking data into metadata or after the end of the file, and nudging the frequency coefficients inside a JPEG (DCT). They differ sharply in how much they can hold, how easily they are spotted, and whether the message survives when the image is re-saved. This guide traces where the idea came from and compares the techniques side by side.
Try the LSB method: the online Steganography Tool encodes and decodes text in images inside your browser, with a live count of how many bytes your image can hold.
A short history of hidden messages
The word comes from Greek: steganos, covered, and graphein, writing. The goal has always been the same. Cryptography makes a message unreadable; steganography makes it look like there is no message at all.
- Ancient Greece. The historian Herodotus tells of Demaratus warning Sparta of a coming Persian invasion by writing on the wooden base of a wax tablet and covering it with fresh wax, so it looked blank. He also describes Histiaeus tattooing a message on a servant's shaved head and sending him once the hair had grown back.
- The name. Johannes Trithemius wrote Steganographia around 1499. It reads like a book about magic but hides methods of concealed writing, and it gave the field its name.
- Inks and microdots. Invisible inks were used for centuries, and in the Second World War microdots shrank a full page of text to the size of a printed full stop.
- Digital images. Once pictures became grids of numbers, it was natural to hide bits in the parts of those numbers our eyes ignore. That is where the modern techniques below come from.
The four main image techniques
1. Least significant bit (LSB)
Each colour channel of a pixel is a number from 0 to 255. The last bit of that number changes its value by at most 1, which is invisible to the eye. LSB embedding replaces those last bits with the bits of your message. With red, green and blue channels, each pixel can carry 3 bits. It is simple, has a large capacity, and is the method most online tools use. The bit-by-bit walkthrough is in how LSB steganography works.
2. Palette-based methods
GIFs and 8-bit PNGs do not store colours per pixel. They store a palette of up to 256 colours and an index into it for each pixel. Palette methods hide data by choosing between near-identical palette entries, or by reordering the palette so neighbouring indices look alike, then flipping index bits. Capacity is lower, and the trick depends on the palette having enough similar colours to hide changes.
3. Metadata and appended data
The simplest trick is not to touch the pixels at all: put text in an EXIF comment or XMP field, or append bytes after the JPEG end-of-image marker, which viewers ignore. Capacity is effectively unlimited, but anyone who opens the file in a metadata viewer can see it, and many platforms strip it on upload. Our Metadata Viewer & Remover lists comments and trailing data and removes both when it makes a clean copy.
4. JPEG frequency domain (DCT)
A JPEG does not store pixels directly. It splits the image into 8 by 8 blocks, converts each block into frequency coefficients with a discrete cosine transform (DCT), and rounds those coefficients. DCT methods hide bits in the rounded coefficients themselves, after the lossy step, so the file can be stored as a normal JPEG. Early tools such as JSteg changed coefficient LSBs directly; later designs such as F5 changed fewer coefficients per hidden bit to be harder to detect. Capacity is lower than pixel LSB, and implementation is much more involved.
Side-by-side comparison
| Technique | Carrier | Capacity | Survives re-saving as JPEG? | How visible to analysis |
|---|---|---|---|---|
| LSB (spatial) | PNG, BMP, lossless WebP | High: up to 3 bits per pixel | No | Detectable with statistical tests |
| Palette | GIF, 8-bit PNG | Low to medium | No | Unusual palette ordering stands out |
| Metadata / appended | Any format | Very high | Usually stripped | Plainly visible in a metadata viewer |
| DCT coefficients | JPEG | Medium | Survives being copied as-is; lost if re-encoded or resized | Detectable from coefficient statistics |
What survives recompression, resizing and sharing?
This is the question that matters most in practice, and the answer for hidden-bit methods is: only an exact copy of the file.
- Converting to JPEG rounds every pixel through the lossy DCT step, which scrambles pixel LSBs completely.
- Resizing or cropping changes which pixel sits where, and most LSB schemes read bits in a fixed order from the top-left corner, so the message no longer lines up.
- Screenshots are a fresh capture of the screen and keep none of the original low-level bits.
- Social platforms commonly resize, re-compress and strip metadata on upload, so treat a posted image as a new file.
- Sending as a file (email attachment, cloud drive, a messaging app's "document" option) usually delivers the exact bytes, and the message survives.
Techniques designed to survive editing exist, mainly in commercial robust watermarking, where a faint pattern is spread across the whole image. They trade capacity for durability and typically carry an identifier rather than a readable message.
Steganography is not encryption
It is worth being clear about what LSB embedding is. It hides the presence of text from a casual look, but it does not scramble the text: anyone who runs the same decoder reads it immediately. It is also not invisible to analysis. Replacing low bits evens out statistical patterns that natural photos have, and well-known tests, such as the chi-square attack described in the late 1990s, flag those changes. Treat LSB as a clever container and a great way to learn how images work, not as a way to protect sensitive information.
Good uses for image steganography
- Ownership notes. Tuck your name, a date or a reference number into an original PNG, like a quiet signature, alongside a visible watermark.
- Puzzles and games. Hidden clues in images are a staple of puzzle hunts, escape-room style games and capture-the-flag challenges.
- Teaching and learning. Hiding a sentence and watching it vanish after a JPEG conversion is one of the clearest demonstrations of binary, colour channels and lossy compression.
- Fun messages. A birthday note hidden in a photo that a friend can reveal.
How our tool implements LSB
The Steganography Tool stores a 32-bit length header followed by your text as UTF-8, one bit in the lowest bit of the red, green and blue channels of each pixel in turn. Only fully opaque pixels carry data, because the browser canvas does not preserve exact colour values in semi-transparent pixels. That makes capacity easy to work out: three bits per opaque pixel, minus the 32-bit header. A fully opaque 1920 by 1080 image has 2,073,600 pixels, which is 6,220,800 bits, or 777,596 bytes of text after the header, far more than most messages need. The tool shows "bytes used" as you type.
Press Hide the message & download and you get secret_image.png. It is always a PNG, because a lossy format would erase the bits. Switch to Reveal Message and load the PNG to read it back; if you load a JPEG instead, the tool explains that JPEG compression erases LSB messages. For the click-by-click version, see how to hide a secret message in an image.
Try It Yourself
Hide a short note in a PNG, then reveal it again, all inside your browser.
Go to Steganography Tool