source stegLibrary.tcl
foreach {photo secret stegSave} $argv {}

# Create Tcl images from the photo image and secret binary image
set baseImg [image create photo -file $photo]
set secretImg [image create photo -file $secret]

set imgWidth [image width $baseImg]
set imgHeight [image height $baseImg] 
        
# Create an empty image the size of the colored photo
set imgWithSecret [image create photo \
    -height $imgHeight -width $imgWidth]
            
# Copy the colored image into the new image
$imgWithSecret copy $baseImg -from 0 0 \
    $imgWidth $imgHeight -to 0 0
       
# Insert the secret image in the low order blue bit
insertDiagram $imgWithSecret $secretImg

# save the new image file
$imgWithSecret write $stegSave -format gif

