subchannel-set!

Synopsis

(subchannel-set! colormap bitmap)

Parameters

  • colormap
  • bitmap

Description

This procedure fills the steganographic subchannel of the colormap with the supplied bitmap (repeatedly and wrapped at the end of each virtual line).

Side Effects

The steganographic subchannel of the colormap is overwritten.

Return Value

unspecified (ok)

Example

Here is a suitable cover image (horses.jpg, JPG, 2400x1600):

horses.jpg

> (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:

horses-subchannel2.png

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:

horses-with-subchannel.png