# Why does image size increase after steganography?

I am working on a steganography technique. Sometimes I need to send my steganographed images online to my friends but in the process the image gets compressed destroying all the data. I found ways to surpass it by using Google Drive or simply mailing them to the destination. But still I am not able to find a reason as why the size of the image increases (nearly to 30%) after the steganography.

Technique used is

1. Read a character from a file.
2. Convert that character to a string of binary bits (from its ASCII)
3. To make it a 6bit binary string, pad it with appropriate 0s
4. Read two consecutive pixels from an image (left to right)
5. Impose the first three bits of the binary string onto the LSBit of RGB of first pixel (first bit on LSBit of R, second bit on G and third bit on B).
6. Repeat 5 for the next pixel
7. Repeat from 1
• With no info on the steganography technique used, we can only state a generality: compression set aside, in a steganography technique sending an image within an image, the output of the encoder is the hidden image, and the apparent image, so by an entropy argument some natural value of the output size is the sum of the input sizes. That said, it is entirely conceivable to make a steganography encoder that compresses to the point that the output of the encoder is smaller than either of its inputs.
– fgrieu
Jan 31, 2016 at 11:57

## 1 Answer

I'll assume the question really is: when I perform low-order-bit steganography on an uncompressed image (inserting 6 bits encoding a character into the low-order bit of 6 bytes coding the R, G and B channels of 2 pixels), I find that compressing the resulting image gives a bigger file than compressing the original image for a given setting of the program used to compress.

The reason likely is that the process which made the original image is such that the low-order bits are very correlated with the other bits (for example this could be because of characteristics of a sensor; or because the original image has been compressed by some lossy algorithm, then decompressed); and that correlation is lost by replacing the low-order bits.

The observed effect will depend on the nature of the compression technique used, and will tend to be be most perceivable for lossless compression techniques (GIF, PNG, lossless JPEG), which are the only ones which allow correct decoding of the hidden message.

If the low-order bits of the original image where random, the observed effect would likely vanish, or even perhaps be inverted (assuming the enciphered message has redundancy).