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.

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.

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

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