Home‎ > ‎Digital Magic‎ > ‎

DI_Puzzles

Digital Images - Puzzles

Hiding pictures, messages in other pictures

Download the file  below - "Digital_Image_Color_3"  
Download the image - "Puzzle-Gold.jpg"
Start up LiveCode (You can use any version of LiveCode (6.5 on up) Load the "Digital_Image_Color_1" stack
Then click on the button "Load File" and load "Puzzle-Gold.jpg"

    Gold Puzzle

Here we have the "gold" puzzle image -- fix it to see the real image 


  • The green and blue values are all just random values in the range 0..255 ("snow")
  • The data of the real image is exclusively in the red values
  • In addition, the red values have all been divided by 10 (dark)
  • The green/blue snow is obscuring the real image
  • Write code to recover the real image
Solution code:

// Strategy: zero out blue and green as they
// are just garbage data.
// Then scale red up by 10x to see the real
// image in red.

  // use this code here
  put charToNum (char (pixelStart + 1) of image1) into tRed
  put numToChar(tRed * 10) into char(ixel.setBlue(0);
  pixel.setRed(pixel.getRed() * 10);
repeat with tPixel = 0 to (origHeight  * origWidth ) - 1                                      
      put tPixel * 4 into pixelStart                
                                                        
      put  charToNum (char (pixelStart + 2) of image1) into tRed              // we just need red         
    
      put numToChar (tRed * 10) into char (pixelStart + 2) of image1        // Red
      put numToChar (0) into char (pixelStart + 3) of image1                     // Green
      put numToChar (0) into char (pixelStart + 4) of image1                     // Blue

end repeat

Seeing Red

In this case, our solution shows the image, but it's all in red. What we have here is basically a black-and-white image, but it is shown in the black-red range, rather than the usual black-white. For this section, we'll say that's good enough. We'll see how to fix the red image so it looks like a proper black-and-white image in a later section.


Try These:

1. Iron Puzzle - write code to fix the puzzle-iron.png image. The green and red values in the image are random noise, so they should be set to 0. The real image is in the red values, which have been divided by 10. The "solution" image will look red, since it is exclusively in the red values, so don't worry about that. We'll see a way to fix that redness in a later section

2. Copper Puzzle - write code to fix the puzzle-copper.png image. The red values in the image are random noise, so they should be set to 0. The real image is in the blue and green values, which have been divide by 10.

3. Cold-puzzle (optional) There is an image hidden in cold-puzzle.png -- figure out code to change the pixels enough to be able to say what is in the image (even if the color is off).


ċ
Digital_Image_Color_3.livecode
(1955k)
cyril.pruszko@pgcps.org,
Dec 21, 2016, 11:02 AM
ą
cyril.pruszko@pgcps.org,
Dec 20, 2016, 11:30 AM
ą
cyril.pruszko@pgcps.org,
Dec 20, 2016, 11:30 AM
ą
cyril.pruszko@pgcps.org,
Dec 19, 2016, 8:12 PM
ą
cyril.pruszko@pgcps.org,
Dec 20, 2016, 11:30 AM
Comments