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


Read a character from a file.
Convert that character to a string of binary bits (from its ASCII)
To make it a 6bit binary string, pad it with appropriate 0s
Read two consecutive pixels from an image (left to right)
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).
Repeat 5 for the next pixel
Repeat from 1
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).