GIFs and PNGs of 2D Plots of Chemical Structures - Introduction

demo img 1 demo img 2 demo img 3 demo img 4

Why GIFs or PNGs ?

GIF (Graphical Image Format) is a portable encoding standard for image data. It is the most common format for images on WWW pages. Chemical WWW pages employ GIFs to show the structures in the text because there is no other portable method to insert a structure plot short of adding a Java widget. However, as a general rule, one should always add a link to the image which leads to a structure file in one of the Chemical MIME types in order to ensure that the structural information is reusable. GIFs are for human browsing only (or chemical OCR as a last resort).

An interesting alternative is the MDL Chemscape Chime plug-in for Netscape. Chime windows, which are embedded in normal HTML pages, have 3D and 2D rendering capabilities comparable to the external RasMol viewer (3D) and ISIS/Draw (2D) and even offer interactive manipulation and automatic rotation or playback of coordinate sequences. However, beware if you serve Chime pages: They can only be viewed when the user has the plug-in installed, and Chime is currently released only for PCs, Macintosh. The SGI version is now officially discontinued and always has been brittle enough to be a danger for the stability of your browser. No releases for other platforms are planned. Since there are no Sun or Linux releases, we avoid to use it on our Web pages, otherwise we would exclude half of our own lab.

The GIF87 and GIF89 standards have come under severe attack since 1994 because they are proprietary formats of CompuServe and Unisys and producers of commercial programs handling (but not simply distributing) GIFs are now (when the format suddenly became so important for the Web) expected to pay license fees. However, there are ways to circumvent the GIF encoding problems by using a less effective, but not patented compression algorithm which is still compatible for the decoder. The disadvantage is that the image file size is notably larger than with the original compression algorithm. Our GIF images use this compression variant to avoid licensing problems. A more powerful and absolutely unencumbered format called PNG (Portable Network Graphics) has been defined in response to the licensing issues, and all recent HTML browsers support it. However, there are still legacy applications which cannot handle PNG. We therefore continue to support both GIF and PNG.

The JPEG image format which is often used for pictures taken in natural settings, where it is far superior to GIF or PNG, is not suitable for line graphics such as structure plots due to the lossful compression algorithms involved. Sharp contrasts such as a black line on white ground are washed out. In contrast, GIF and PNG are lossless compressors and regenerate the full image information. Their compression rate is very high if large monochrome fields are present (such as in the background of structure plots), but becomes very low for images with many subtle nuances - this is the JPEG domain.

How do I create a GIF or PNG image of my structure?

Several possibilities exist:
  1. If you only have a few structures, load it into a structure editor.
  2. If you want free software, use the CACTVS editor in version 2.14 and upwards, which produces both connection tables in a number of structure file formats and GIF/PNG images (plus VRML as a bonus). The editor works on the most important UNIX operating system variants.
  3. Use the Daylight Depict service. It accepts a SMILES string as input and returns an HTML page with an embedded image. Unfortunately, you don't have any control about the output style and image size, and the beauty of the result is in the eye of the beholder.
  4. Or you use our GIF generation service, which you are just now reading about.
For WWW applications, it can be useful to generate GIF and PNG graphics interlaced. This means, image lines (GIF) or blocks (PNG) are not stored in order, but in an interwoven pattern. During download, the Web browser can interpolate the image data and present a coarse, but already recognizable image when only a fraction of the data has been transported. The images you can obtain here can be interlaced.
Furthermore, the image size should be specified in the <IMG> tag line, i.e. something like
<IMG WIDTH=150 HEIGHT=150 SRC="img.gif">
This way, the HTML browser will be able to proceed rendering the text part of the page even if the image has not yet been received. Either you put in the image size when you link it in, or you can use the WWWis utility to insert image sizes into sets of Web pages automatically any time later.

Converting Large Structure Sets

Pasting structure after structure into an editor or a Web page is tedious, we agree. We were not surprised to receive numerous requests for batch-mode converters transforming multi-record files and file sets into image collections. We have developed software to handle this task. However, we feel that these features are mostly of use to commercial enterprises and therefore ask for a licensing fee if you need a solution for this kind of problem and cannot prove that the application is only used in a non-commercial context.

Another popular request is a dynamic image generator, which is driven by data encoded in cgi-style image URLs, similar to the Daylight daycgi package. For good performance for pages with many dynamically generated images, the generator should not be started anew for each image. Rather, a constantly listening image generator process should be responsible for all image generation requests. We have developed a combination of an Apache Web server module and an image generation server for this kind of application scenario. Like with the batch converter, we expect you to license the software, if you are a commcerial enterprise.

Anyway, if you have any question or a request for a custom adaptation of a chemistry image generation procedure, please do not hesitate to contact us.

Usage conditions

You can use the images generated by this service free of charge for almost every purpose you can imagine. If you put them on a Web site, the HTML document embedding the image must contain a link to this page. A small footnote is sufficient.

However, after some unfortunate experiences with other free data we provided to the Internet community, you are explicitly forbidden to include these images in any CD or other medium you charge for without prior contact and an agreement in writing. The images contain embedded, invisible copyright information which can be read back by suitable tools.

We will treat your structures confidentially, but they travel unencrypted on the Internet, and we log them to evaluate program performance.

Last Change: 2001-04-17 W. D. Ihlenfeldt