Image Steganography Hiding images in images Bottom couple bits of the image have another image inside them Remember each pixel is an rgb value 8 bits each The lower bits of the rgb values are not noticable noise button onclick shift 1 Left button Shift span id sa 7 span pixels rgb 8bits each Example span id example span button onclick shift 1 Right button br script document body style height 400px var img null async img document createElement img img src https notebook xbdev net var images cartman png await img decode const imageCanvas document createElement canvas document body appendChild imageCanvas var imageCanvasContext imageCanvas getContext 2d let shiftamount 0 var ZZ 00000000 function pad n x return ZZ substring 0 n x length x function hex n return pad 2 n toString 16 function bin n return pad 8 n toString 2 function shift dir shiftamount shiftamount dir if shiftamount 0 shiftamount 0 if shiftamount 7 shiftamount 7 document getElementById sa innerHTML shiftamount imageCanvas width img width imageCanvas height img height imageCanvasContext drawImage img 0 0 imageCanvas width imageCanvas height var imageData imageCanvasContext getImageData 0 0 imageCanvas width imageCanvas height for let i 0 i imageData data length i let r imageData i imageData data i imageData data i shiftamount 0xff end for i imageCanvasContext putImageData imageData 0 0 display data for pixel 0 document getElementById example innerHTML bin imageData data 0 0xff document getElementById example innerHTML bin imageData data 1 0xff document getElementById example innerHTML bin imageData data 2 0xff end shift onload function shift 0 console log ready script
shiftamount shiftamount dir if shiftamount 0 shiftamount 0 if shiftamount 7 shiftamount 7 document getElementById sa innerHTML shiftamount imageCanvas width img width imageCanvas height img height imageCanvasContext drawImage img 0 0 imageCanvas width imageCanvas height var imageData imageCanvasContext getImageData 0 0 imageCanvas width imageCanvas height for let i 0 i imageData data length i let r imageData i imageData data i imageData data i shiftamount 0xff end for i imageCanvasContext putImageData imageData 0 0 display data for pixel 0 document getElementById example innerHTML bin imageData data 0 0xff document getElementById example innerHTML bin imageData data 1 0xff document getElementById example innerHTML bin imageData data 2 0xff end shift onload function shift 0 console log ready script