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 web pages. Chemical web pages employ GIFs to show the structures in the text because it is one of the simplest ways to insert a structure plot. Other possibilities are to add a Java applet such as Jmol or a JSmol JavaScript Object. 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).

The GIF87 and GIF89 standards were embroiled in some controversy starting 1994 because they were proprietary formats of CompuServe and Unisys. Producers of commercial programs handling (but not simply distributing) GIFs were expected to pay license fees. Even though all relevant patents had expired by 2004, these licensing issues spurred the development of a more powerful and completely unencumbered format called PNG (Portable Network Graphics), which all recent web browsers support. However, there are still legacy applications which cannot handle PNG and issues in older versions of Internet Explorer. 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 well suited for line graphics such as structure plots due to the lossful compression algorithms involved. Sharp contrasts such as a black line on white background 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.
    • Then either take a screenshot from your favorite molecule editor and convert the dump to a GIF. Really awkward.
    • Or use a commercial molecule editor which directly supports GIF output. This is now a widely supported feature found in most packages such as ChemDraw.
  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). Or use the Web Sketcher demo, which can export structures in PNG format.
  3. The previously widely used Daylight Depict service for converting SMILES to an HTML page with an embedded image doesn't seem to be active any more.
  4. Or you use our GIF generation service, which you are just now reading about.
  5. Of course, don't overlook our Chemical Identifier Resolver (CIR). CIR allows you to create GIF structure images from a wide varity of input formats.

For web 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 created interlaced.
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. Interlaced images were important back in the day of slow dial-up connections but have lost importance with today's generally fast connections.

Converting Large Structure Sets

Pasting structure after structure into an editor or a web page is tedious, we agree. As of now, no dedicated API has been developed for the GIF Creator service. If you have the need for batch-mode conversion of multi-record files and file sets into image collections, you may want to look into solutions such as the stand-alone version of the chemoinformatics toolkit CACTVS (which is the software actually generating the images in this service). Various licensing rules apply for academic and commercial use.

Similar advice applies if you need a dynamic image generator, i.e. driven by data encoded in cgi-style image URLs, in the vein of Daylight's DCGI 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, which can be provided by a combination of an Apache Web server module and an image generation server for this kind of application scenario.

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, we would appreciate if the HTML document embedding the image contained a link to this page. A small footnote is sufficient.

Large-scale commercial usage is discouraged. There are better solutions for that. Even if the intended use is for a non-commercial purpose, we definitely prefer to be informed beforehand if a massive number of structures is going to be processed. In such cases, please send us an email. We are willing to help and and to look at the possibility of processing your structures as a batch job without going through the web interface - without however being able to make any promises.

We will treat your structures confidentially. We can log them to evaluate program performance; but we neither have the interest nor the resources for looking at any specific structures you submitted.

M. Nicklaus

Last Update: