Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. Now you're ready to decode the image. The image is rendered by stacking the layers and aligning the pixels with the same positions in each layer. The digits indicate the color of the corresponding pixel: 0 is black, 1 is white, and 2 is transparent.
  2.  
  3. The layers are rendered with the first layer in front and the last layer in back. So, if a given position has a transparent pixel in the first and second layers, a black pixel in the third layer, and a white pixel in the fourth layer, the final image would have a black pixel at that position.
  4.  
  5. For example, given an image 2 pixels wide and 2 pixels tall, the image data 0222112222120000 corresponds to the following image layers:
  6.  
  7. Layer 1: 02
  8. 22
  9.  
  10. Layer 2: 11
  11. 22
  12.  
  13. Layer 3: 22
  14. 12
  15.  
  16. Layer 4: 00
  17. 00
  18.  
  19. Then, the full image can be found by determining the top visible pixel in each position:
  20.  
  21. The top-left pixel is black because the top layer is 0.
  22. The top-right pixel is white because the top layer is 2 (transparent), but the second layer is 1.
  23. The bottom-left pixel is white because the top two layers are 2, but the third layer is 1.
  24. The bottom-right pixel is black because the only visible pixel in that position is 0 (from layer 4).
  25.  
  26. So, the final image looks like this:
  27.  
  28. 01
  29. 10
  30.  
  31. What message is produced after decoding your image?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement