

Compliant programs will show the full picture with a grid of black lines, and non-compliant programs will show the thumbnail picture with a grid of white dots. We will then merge this with the thumbnail at “normal” gamma of 2.2, which should be pulled down to black. We will be “hiding” the full image in the high brightness pixels, and setting a large gamma to pull them back down. Because there is typically one column much taller than all the rest, I set this column red, and instead scale the image up to show the clarity. The histogram shows black pixels as a column on the left, get progressively brighter pixels as you go right, and end at the right with full brightness. Additionally, I have included a Histogram of the pixel brightness, so you can see what’s going on. To show how this program works, I have dumped the internal state of the two pictures as they process through. Compliant programs will show the full image, while non-compliant programs show the thumbnail. Running this will take two images, a thumbnail and a full image, and produce a final image with both present.
DYNAMIC GAMMA CONTROL CODE
Here’s the source code to get started: git clone Browsers actually do handle gamma correctly, so we can use this difference in behavior to make a picture that looks different based on what program you view it with. Rather than shame them, let’s exploit this behavior to hide one picture inside of another. The number of programs that get this wrong is surprisingly high, including some big names like Adobe Photoshop and Facebook. This has resulted in surprising behavior, because most programs don’t handle the case where gamma is different. In fact, with the success of the Internet, almost all programs today assume this is correct value. This allows pictures to have a higher dynamic range for colors, at the cost of losing some accuracy around the brighter colors.īut what exponent to choose? The most common exponent, called gamma, is 2.2, which is commonly associated with sRGB. For digital imaging, when a pixel is displayed to the screen, the brightness is scaled by an exponent. This feature has been part of analog and digital imaging since the early days of Television, and was meant to work around limitations for darker colors. Most programs that handle pictures don’t support a little known feature called Gamma Correction. If your computer is like mine, the output picture should look pretty different! Here’s what I see: Here’s a cool trick: try downloading this picture and looking at it in your file browser: Update: You can make these in your browser: Click Here
