Want updates? Opt out any time

« First-of-its-kind workshop | Main | Visual crossplotting »

How to cheat at spot the difference

Yesterday I left you, dear reader, with a spot the difference puzzle. Here it is again, with my answer:

Notice how my answer (made with GIMP) is not just a list of differences or a squiggly circle around each one. It's an exact map of the location and nature of every difference. I like the effect of seeing which 'direction' the difference goes in: blue things are in the left image but not the right. One flaw in this method is that I have reduced the image to a monochrome image; changes in colour only would not show up. 

Another way to do it, a way that would catch even a subtle colour change, is to simply difference the images. Let's look at a detail from the image—the yellow box; the difference is the centre image:

The right-hand image here is a further processing of the difference, using a process in ImageJ that inverts the pixels' values, making dark things bright and vice versa. This reveals a difference we would probably never have otherwise noticed: the footprint of the lossy JPEG compression kernel. Even though the two input images were compressed with 98% fidelity, we have introduced a subtle, but pervasive, artifact.

So what? Is this just an image processing gimmick? It depends how much you care about finding these differences. Not only was it easier to find all the differences this way, but now I know for certain that I have not missed any. We even see one or two very tiny differences that were surely unintentional (there's one just next to the cat's right paw). If differences (or similarities) mean a lot to you, because a medical prognosis or well location depends on their identification, the small ones might be very important!

Here's a small tutorial showing how I made the line difference, in case you are interested →

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments (6)

Damn, I just left a comment on the previous post. I missed the icing and the curtain.

Your quote at the top of the previous post ("To clarify, add detail") also got me thinking about another lesson I've learned. The skill, and the art, of creating informative diagrams or images is knowing what to show and also what not to show. Sometimes too much information will be a distraction and it will muddy the waters, and you will get more effective material by taking some pieces away.

This can be accomplomished by literally taking things away (removing "layers" of data for example), or by graphic techniques, such as use of colour. If you want to bring attention to something, pick that as your yellows or reds; if something if there for context, make it blue or gray, et cetera.

I find that inverted image with the JPEG artifacts to be quite interesting; I didn't expect you to go there, but in a "As-it-relates-to-geophysics" way it makes perfect sense. If you were using a similar method to find differences in geological data, you need to be aware of these sort of 'false positives' (false differences?) in the data.

I remember a post you guys had a while ago about something similar; at the time I think it was more relating to the depth of data you are using.

August 3, 2011 | Unregistered CommenterReid

@Reid: Thanks for another thoughtful comment. What you say about using colour sparingly is key. As Tufte puts it, the 'minimum discernible difference' is usually all that's required for each dimension of the data, leaving some visual bandwidth, so to speak, for other dimensions. The other mindset I like is to think of the data in visual 'layers'—a classic approach in cartography.

August 3, 2011 | Registered CommenterMatt Hall

Got me thinking about 4D interpretation and not scaling both data sets similarly before interpreting saturation and pressure differences. Heh.

August 5, 2011 | Unregistered CommenterMaitri

@Maitri: Hmm... cool problem. Strikes me that you could compute the absolute difference. Intuitively, I think the scaling should be correct when the difference is minimal. If you try this with images of seismic data, remember to use TIFF or, better, PNG file format! One day I will post my SEGY to TIFF workflow...

August 5, 2011 | Registered CommenterMatt Hall

Great post!

Funny, I missed the icing and curtain too. I wonder if there's anything particular about those 2 that make them harder to spot.

Another good reason to avoid saving images in JPEG compressed format is if we're planning to corender 3 attributes in one image using RGB blending. This is because any convolutional operation such as smoothing or sharpening that we may apply to the result will be affected by the lossy compression. This is because the convolution is applied separately to each of the three channels, R, B, and G, with resulting shifts in colors that are different for each channel. The result is the introduction of new colors that were not in the original. Also further processing operations will be negatively affected. One way to avoid it is to work in Lab color space and only apply the convolution operation to the L (Lightness) channel. But since working in lab space is seldom available, my preference goes to save blended images in uncompressed Tiff format.


August 9, 2011 | Unregistered CommenterMatteo

@Matteo: Thanks for the comment. Interesting point about the cartoon... those two features are simple scale changes, with nothing dramatically appearing or disappearing. Perhaps they are somehow less conspicuous because they are more qualitative?

I did not know that about JPEG. I almost never use it nowadays, preferring PNG, which uses lossless compression. This means it doesn't do much for some images, but is almost as good as JPEG for others (simple images with small colour palettes).


August 9, 2011 | Registered CommenterMatt Hall

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>