The GIF (and its extended family of PNG, JPEG, TIFF, BMP, etc.) are major destroyers of scientific data. This post shows why they should be avoided for much scientific data. (The GIF has additional infamy through the patent fiasco). In this post I'll us "GIF" to refer to all bitmapped formats (as opposed to vector formats such as SVG).
All bitmapped images contain data captured as individual pixels. The resolution of the data cannot, therefore be better than the separation between pixels. The problem occurs when a high-resolution object (such as a spectrum) is captured as a GIF. A spectrum in chemistry typically has a resolution along the x-axis of ca. 16, 000 points, while a GIF may have 1000, Therefore 94% of the data are lost in coverting from spectrum to GIF. Sometimes the conversion involves dithering pixels so that the final image looks somewhat more beautiful but this adds no information and usually destroys some. Anyway, here goes:
Text and chemicals:
- a bit diificult to read, so let's magnify it:
Bigger but not much better...
... now we see the full horror - the dithering hasn't added information - it just hid the problem.
It isn't just that we have jaggies, but we can actually lose information in a seriously misleading manner. Here's a chemical reaction:
This looks very pretty. But suppose we have to shrink it just a little bit (say 10%). Now we get:
What's happened? The lines used to be one pixel wide. When the picture was shrunk the converter had to decide whether the line was in a vertical line of pixels. It just missed, so it's not been drawn. This corrupts, rather than destroys the chemistry - it could be mistaken for a different molecule!
In practice the greatest destruction is probably in the spectra. Remember they have a resolution far greater than the screen. But here are some pixel-based spectra from supplemental data. You can find these in all publishers' repositories...
The resolution of the spectrometer is probably 0.001 in the vertical axis - the GIF can only manage about .025
Here the spectrum has been dithered but that can't save it. Again the actual data resolution is probably 50 times what you can see.
And this is one of the best. It was a proper digital spectrum. It's been printed out (losing some of the metadata such as frequency), been annotated with the compound on a Post-it (though we cannot make sense of what is attached - it seems to be related to a different spectrum). Then it has been photcopied - losing resolution again. We don't know how it got to the publisher, but here is their record of the scientific experiment.