# Hidden messages

Mapp and Lucia aficionados are clearly at an advantage here. This was part of a birthday treasure hunt for someone special: a poster hanging at the Barbican Library, and a transparency in a book at the Guildhall Gallery that, when overlapped, gave a cue.

The poster. Sesquiannual meetings!

The transparency. The parallel bars are a different puzzle.

A small academic cottage industry has improved methods for hiding information so that it is only revealed if innocuous-looking pictures are overlapped. Properly done visual cryptography can offer the strength of a one-time-pad and still be decoded by merely overlapping a pre-defined number of transparencies (or “shares”) with seemingly random or unrelated patterns.

No such pretensions here though, and a very simple method was used: I represented each grayscale pixel in the patent (i.e. obvious) images with a 2×2 black-and-white matrix.  0 – 1/4 – 1/2 – 3/4 – 4/4 of the matrix was black, depending on the darkness of the original pixel. When dithering an image this way, for middle tones there is a choice of different patterns with equal darkness. For example, there are six ways to set half the matrix black: ▚, ▞, ▌, ▐, ▀, ▄. Depending on the pattern combination, two overlapping 1/2 black matrices can be 1/2, 3/4, or 4/4 black:

▚ + ▚ = ▚   or   ▀ + ▀ = ▀

▚ + ▌ = ▙   or   ▀ + ▐ = ▜

▚ + ▞  = █   or  ▀ + ▄ = █

and so on.

Generally a 2×2 matrix in the hidden image can represent any grey that is at least as dark as the most dark of the overlapping two matrices. At most it can be as dark as the sum of the two overlays. Usually more than one combination of matrices can reach the same result. A bit of randomisation in combination choice then goes a long way in hiding the latent image. If a required combination is unattainable I minimised the total error. Some error diffusion to the neighbouring pixels in the patent and latent images could probably help further in keeping them recognisable (although Floyd-Steinberg error diffusion was no improvement in this case).

The patent image tones should be ideally in the middle range. Flat white and very bright areas on one or both patent images are undesirable as either only very bright latent tones are achievable, or all the supposedly hidden information ends up in a single layer. Black areas in patent images do not leave much choice for the latent image. The latent image is best in the mid-to dark range. I reduced both patent images to three middle grey tones using Floyd-Steinberg error diffusion. Larger than 2×2 matrices could represent more grey tones, but too small sub-pixels make it hard to manually align images perfectly. With some more sophistication different grey levels instead of black or white only could be used for the sub-pixels for more grey tones and better tonal match in the latent and patent images.

As a final practical note, using the same laser printer for both patent images, and deactivating any rescaling and resampling is important.

Here you can try overlapping yourself of what looks like dot matrix printouts of olden days (scroll left or right). To me, each time it is like magic.

The originating R script is here: weave3.R, without any warranty of usefulness, as it is very much a single purpose script.