(subchannel-set! colormap bitmap)
This procedure fills the steganographic subchannel of the colormap with the supplied bitmap (repeatedly and wrapped at the end of each virtual line).
The steganographic subchannel of the colormap is overwritten.
Here is a suitable cover image (horses.jpg, JPG, 2400x1600):
> (define image (colormap-readjpg "horses.jpg")) image > (define bitmap (bitmap-scale (string->bitmap " ** SECRET MESSAGE ** ") 4.0 4.0)) bitmap > (subchannel-set! image bitmap) ok > (define subchannel (subchannel-get image)) subchannel > subchannel #<bitmap orow:-1 ocol:-1 xres:-1 yres:-1 w:2400 h:1600> > (bitmap-writepng subchannel "horses-subchannel2.png") ok > (colormap-writepng image "horses-with-subchannel.png") ok >
The subchannel as written to the PNG file horses-subchannel2.png displays as follows:
The subchannel is very fragile, in order to preserve it in a cover image, a lossless data format such as PNG needs to be chosen. JPG compression at any quality would immediately destroy any existing subchannel information.
The modified image written back to the PNG file horses-with-subchannel.png displays as follows: