Publication-Quality Images with UCSF Chimera
28 April 2009 Class Notes

Audience

This class is designed to help scientists, not artists, use UCSF Chimera to create images of their data. (If you collaborate with an artist, you often get better results.)

Students are expected to have already used UCSF Chimera to view their own data. This class will cover the typical workflow for creating a publication-quality image. The techniques may help you improve your interactive use of chimera, but that is not the focus of this class.


Introduction

There are many ways to produce images with chimera: In this class, we're going to focus on generating images for journals directly from chimera.

Image Workflow

  1. Prerequisites
  2. Emphasize important parts
  3. Save your chimera session
  4. Save the Image
  5. Repeat from step 2 until satisfied

When you have everything setup just right, it's time to save your chimera session. There is a good chance you'll want to make modifications based on feedback from your colleagues or the journal. Or maybe you'll want to make a different sized picture of the same image.

Animations will be discussed in next weeks class.


Prerequisites

Before creating an image, it is very helpful to know what environment the image will be viewed in. On a web page? In a magazine? Full-page? Quarter page? Poster? Journals require that all text in images be readable at the printed size. You should also know what media the image will be printed on and you should be aware of the problems color-blind people will have.

Problems with Color

When creating images, it helps a lot to know what device the image will be printed on, because the color gamut can vary tremendously from device to device. Chimera does not have any tools to manage color workflow, so you'll need (1) an image editing program like Adobe Photoshop, or GIMP; and (2) color profiles for your monitor and printer. An image editing has other uses as well that will be pointed out throughout the class.

Why color profiles?

Serious home photographers already know this, but for the rest of you: you need to start using Color Management System (CMS) software. A CMS uses color profiles of your devices (cameras, monitors, printers) to match the colors as well as it can. So when you print an image, it will more closely match the colors on the monitor (because printers can only reproduce a subset of the the colors a typical monitor can display). In particular, the really bright colors you see on a monitor are not reproducible on CMYK printers (photo printers often have additional inks that improve the color reproduction).
Converted to CMYK (US Web Coated SWOP v2) Original RGB
Image by Jeff Schewe Image from Cadmus's Guidelines for Submitting RGB Digital Art
(Color profiles are sometimes referred to as ICC profiles.)

After you save the image with chimera, you should resave the image with an image editing program to embed a color profile into the image file (someday this will be automatically down for you). That color profile is then used together with your printer's color profile by the CMS to match the colors as well as possible (since the range of colors that monitors and printers produce (their color gamuts) are quite different).

Embedding a color profile is also good for emailing the picture to someone else so they will see similar colors on their calibrated monitor or printer. And newer web browsers use an image's color profile too (at this time, Apple's Safari, optionally in OmniWeb Mac, and optionally in Firefox 3). To see if your web browser supports color profiles, visit ICC profile checker.

To turn on Firefox's color profile support, go to the about:config web page and set gfx.color_management.enabled to true.

CMS software is well integrated into to Microsoft Windows and Mac OS X, with Linux slowly catching up.

Color profiles for Monitors
Ideally, you would color calibrate your monitor all of the time, since the colors vary with the monitor's age, how long it has been turned on, how warm it is, and the amount of ambient light. But that is not practical. Normally, you can get away with using the color profile provided by your monitor's manufacturer. And if you do have the a color calibration tool, calibrating once a month may be often enough. Also keep in mind that the colors on two identical monitors can be different, especially if they are adjusted differently, but also due to natural variations and the local environment.
Color profiles for Printers
Colors on a printer vary with the inks used and the paper (they ignore the amount of ambient light). Since the inks are stable for a long time, typically you will just use the color profile provided by the printer's manufacturer. But again, for more accurate results, you will color calibrate it with the actual ink and paper used.

Color-blindness

Nearly eight percent of men have some sort of color-vision impairment, a.k.a. color-blindness (and less than one percent of the women), so chances are that some of your colleagues will have problems distinguishing colors in your images.

One way of “fixing” the colors is to use a tool like Vischeck's Daltonize tool but that may alter the colors too much.

These abridged rules from http://jfly.iam.u-tokyo.ac.jp/html/color_blind/ will help too:

Red is not as big an issue for molecular images, because the surface shading and highlights naturally increase contrast.

Presets

Start up chimera (the Aqua version on Mac OS X) and open a PDB file.

From the chimera User's Guide section on presets:

Publication presets are intended for generating images for presentation and publication. They do not change what items are displayed or their colors, but may change their styles and the color of the background. For example, choosing a preset with rounded ribbon or licorice will not turn on ribbon display, but will adjust any currently displayed ribbon segments; similarly, only the currently displayed atoms and bonds will be shown as sticks. Publication presets may decrease interactive performance because finer divisions are used to depict curved objects (molecular surfaces, ribbons, etc.).
Presets are a shortcut for doing many operations at once. We will be going over the individual controls in the following sections.

Image Save Dialog

Chimera's Save Image dialog has a myriad of options. First choose the size and print resolution of your image based on the journal's requirements. Next choose whether or not to raytrace the image with the POV-Ray program. Raytracing provides better shadows and specular highlights, but doesn't show silhouette edge enhancements.

If you're not raytracing, then make sure your Image Credits preferences is up-to-date with your name and copyright information, so it will be embedded in images saved directly by chimera. The description is optional. And you can also generate stereo pair images at twice the width given, as well as input images for a lenticular interlacing program. The default 3x3 supersampling can be reduced for lower quality “draft” images. For non-multisampled windows, you might want to increase it to 4x4, but in general, improvements from higher settings are not noticeable.

Journal requirements

Journals have specific requirements for the images they accept. The physical size of images is limited by the page size and column width. The resolution needed of images depends on the image type: color, line-art (wireframe), or mixed/combination, with color needed the lowest resolution and line-art the highest. A color image with text in it is considered mixed. Chimera can generate images at any resolution (limited by available memory) so do what the journal asks.

Some journals ask for CMYK images. Since the conversion of RGB images (what chimera does) to CMYK is dependent on the inks and paper the printer uses, ask which CMYK standard the journal uses (e.g., US Web Coated SWOP v2 or Euroscale Coated v2), and use your image editing tool to convert the image. Photoshop also has a Proof Colors viewing mode that lets you see what the differences will be. If you are making the prints yourself, you can do similar proofing using the color profile of your printer.

Journals also frequently ask for all text to be in the Arial font. Chimera uses the Free Sans font from the Free UCS Outline fonts, instead of Arial (primarily because Arial is missing the Angstrom symbol). Both fonts are sans-serif fonts, so if a journal ever complains, please let us know.

The font size requirement is really a request that the text be readable at the printed image size. A point is 1/72 of an inch, so a 8 point font is 1/9 of an inch high. Chimera's font sizes are in pixels and they are scaled by the print resolution to maintain their relative size to the rest of the image. A future version of chimera will report the current font size in points in the Save Image dialog.

Journals also ask to be given TIFF files. For historical reasons, chimera saves uncompressed TIFF files, so you will need to use your image editing program and resave the image using compression. (Since the patent on the compression algorithm has expired, chimera may be modified now to save compressed TIFF files.) Since you should also use the image editing program to add a color profile , this is not as annoying as it could be.

Here are some journals and their requirements (as of July 2008):

PLOS Computation Biology
Summary of article figure requirements: 8 points is 1/9 of an inch and 12 points is 1/6 of an inch.
PNAS
Summary of article figure requirements: Halftone means color. Treat chimera images without textual annotations as halftone. And treat chimera images with textual annotations as combination. 6 points is 1/12 of an inch.
Structure
Summary of article figure requirements: Do not save your images in the JPEG format because it is lossy. EPS files are larger than TIFF files and are generated by chimera with a conversion program, so no reason to use it either. Chimera doesn't create PDFs, but it would have the same disadvantages as EPS files. 1/2 point is 1/144 inches.

Lenticular Images

Chimera supports the generation of 3D lenticular images. Special lenticular interlacing software is needed to postprocess the chimera output. When preparing lenticular input images, preview the image in stereo and limit how much of the model sticks out of the screen. Examples will be shown in class.

Raytracing

To see where the shadows will be, turn on shadows in chimera. Increasing the subdivision quality only helps ribbons — still able to see subdivisions in shadows, use higher subdivision quality and supersmooth to mitigate. You can edit the POV-ray input files if need be (e.g., turn on shadows for fill light). POV-ray doesn't put appropriate meta-data into image file, so you'll need to add copyright and author with image editing tool and as well as add the monitor's color profile.

Stereo Images

Even though about 12 percent of people have problems seeing stereo, a stereo image is very useful for communicating the spatial relationships in your data. Chimera has several alternatives for saving stereo images. If you don't have any saturated colors (grayscale is best), the simpliest way is to switch the camera mode to red-cyan (anaglyph) stereo and save it that way. The next best way is in the Save Image dialog to change the image camera mode to stereo pair.

To generate a great stereo image, chimera needs to know the physical width of the image, the distance between the eyes, and the distance to the image. The distance to the image, the viewing distance, doesn't need to be exact because your brain can compensate very well, but it can't be far off. By default, chimera will adjust the field of view angle to keep the same viewing distance in the printed image. That will change the divergence between the left and right eye images.

The dashed line in the top Side View represents the focal plane — for stereo purposes that is also the plane of the screen. To get the right depth effects in stereo, you should switch the camera to a stereo mode for previewing and adjust the focal plane to be at the depth of what you're focusing on. Also be sure to eliminate objects that are sticking too far in or out of the screen because the eyes have a difficult time focusing on extremes.


Emphasize Important Parts

  1. Background Preferences
  2. Change Colors
  3. Attributes
  4. Tweak Representation
  5. Add Effects
  6. Annotate
A nice thing about molecular visualization is that no one has ever seen an individual molecule. All images are abstractions. That is also a liability, as there are no everyday architectural details that would form a frame of reference for understanding the shape. That makes spatial cues very important, 3D clues like perspective, shading, shadows, motion, and stereo are needed to convey the shape.

The human eye is drawn to areas of high contrast. So you should reduce the contrast in unimportant areas of your image. That includes simplifying the representation, reducing the number of colors, and fading out unimportant sections either with transparency or less contrasting colors.

To see some of the possibilities, visit the Chimera gallery.

First let's review some of the chimera tools used to make your image. This information is also present in the chimera User's Guide Tips on Preparing Images.


Background Preferences

Often overlooked are the backgroud preferences. The important choices here are the background color and the 3D label appearance. If you want the defaults to be different, Save them.

Change Colors

Color is very good for controlling the contrast of your image. For a typical journal image, you would select a white background to match the page color and fade the unimportant areas by coloring with pastel (light) colors, and the important areas with darker colors. You can also fade objects with depth cueing or by making them transparent.

While you can change colors with the Color (Actions) menu, you have the most control over colors in chimera when you use the Color Editor (Utilities) tool. The color editor is shown whenever you pick the interior of a color well in a dialog, e.g., the selection inspector, or the model panel, . Picking the color well's border turns on getting the color from the color editor. The color editor provides several different color spaces in which to describe a color: RGB, HLS, HSV, CMYK, and Gray. The HLS and HSV color spaces are the easiest to pick distinct colors in.

From Apple's Color Management Overview

The color editor is also where you can specify transparent colors, by pressing the Opacity button and specifying the A, a.k.a. alpha, value. Zero alpha is fully transparent and one is fully opaque. For surfaces, there is a shortcut for setting transparency in the Actions menu.

Selecting No Color causes the the associated objects to revert to their default colors. For example, an atom with no color has the same color as its molecule.

In addition to the Color (Action) menu, there are several Depiction tools that can help: the Color Secondary Structure, Rainbow, and Color Zone, as well as Surface Color (Volume Data) offer different coloring schemes.

If you are having problems selecting appropriate colors for your images, you should visit a web site about color theory, such as Wikipedia's page on color theory. Another good resource is the ColorBrewer web site that helps you choose distinct colors for sequential, diverging, and qualitative comparisons.

Attributes

Lots of display attributes are hidden in dialogs. For instance, use the Selection Inspector to change attributes of selected objects. And in the Model Panel, you can double-click or pick the attributes... button to bring the model's attribute dialog.


Tweak Representation

While you are probably aware how to modify the representation of a molecule with the Select and Action menus, you are probably less aware of the Depiction tools and their capabilities. In particular, the Per-Model Clipping and Surface Capping tools are very useful for cutting away parts of surfaces. Pipes and Planks and Nucleotides provide alternate representations of secondary structure and nucleotides, respectively. You can alter the ribbon cross section with the Ribbon Style Editor. And you can alter sizes and colors based on various attributes with the Render by Attribute tool.

The unimportant parts of your image can be deemphasized by using a simplier representation for those parts.

For example, changing the representation can make a huge difference. The following two images are of a ribosomal subunit, PDB Id 1jj2. The left image is similar to one in the chimera image gallery with low resolution surfaces placed shown for the ribosomal RNA and each protein. The right image replaces the RNA surface with a RNA depiction.

re-creation emphasize the RNA-ness

Nucleotides example:
edged ribbon, box slab base double diamond ribbon, custom slab base

transparent surface

normal 30% transparent 30% transparent, one layer

Add Effects

Lighting tool
The Lighting (Viewing Controls) tool provides three interfaces: a basic lights interface, an advanced lights interface, and a material shininess interface to alter the specular highlights. For manipulating the lights, except for changing the color of a light, you should stick to using the basic interface. Chimera uses two lights: a key light that can optionally cast shadows, and a fill light. Changing the key-to-fill ratio changes how dramatic the lighting is. It is also useful to turn on shadows and move the light before raytracing the image.

A new feature of the lighting tool is the ability to change the quality of the lighting from normal to glossy. Glossy lighting uses a (slower) graphics technique to tighten the highlights and increase the opacity of edge on translucent surfaces, so there is less need to raytrace your images.

basic lighting shininess


Effects Dialog

The Effects dialog provides many options.
Subdivision quality
When saving an image, the subdivision quality is set to a minimum of 5. Which affects sphere, cylinders, and ribbons. Increasing the surface smoothness needs to be done by hand.
shadows
(In the Effects (Viewing Controls) tool.) The interactive shadows are current crude and are meant for previewing where the raytraced shadows will appear.

normal shadow

Depth Cueing
(In the Effects (Viewing Controls) tool.) Depthing cueing is on by default and does a linear fade. While you can fade to a different color than the background, the raytracer does not support it directly (you would need to set a transparent background for the raytraced image and composite it onto the correct background).

depth cueing to background (normal) depth cueing to black no depth cueing

Silhouette Edges
(In the Effects (Viewing Controls) tool.) To help your image "pop" from the background, turn on silhouette edges. This is more important for gray-scale images, but can be helpful for color images as well.

normal silhouette

multisampling

no multisampling closeup

multisampling closeup

Transparent Background
(In the Effects (Viewing Controls) tool.) Useful for compositing over other images. For saving images directly from chimera, you need graphics hardware support (or else the button won't switch to true), but if you raytrace the image, you can get transparency if you enable it. Enabling the transparent background doesn't actually make it so, you Need to set background color to a transparent color. Use Background tab of the Preferences dialog, invoke the color editor for the background color. If you are going to composite over an image with lighting effects, you should modify the chimera lighting to match and change the non-transparent part of the background color to the average intensity of the destination image.

normal composite

Clipping
Chimera provides hither and yon clipping as well as per-model clipping.

normal clipped

ambient occlusion
The Surface Color (Volume Data) tool can be used to fake ambient occlusion in semi-spherical surfaces, the effect where ambient light is blocked in recesses and crevices. First enable the Options, then center the surface, Set the full range of surface values, switch to a Gray palette, and then Color the surface. Note that: if you are going to raytrace the final image, or if you have shadows on, this trick is less useful.

normal ambient occlusion


Annotate

Chimera provides many ways to annotate your image. You could also use an image editing program. Chimera has:
3D labels
3D labels can be attached to atoms and bonds and they are correctly positioned in stereo.
2D labels
The 2D Labels (Utilities) tool allows you to overlay text on the image. But keep captions separate so the journal can use whatever font it wishes. 2D labels appears to be at the focal plane in stereo views and that will be confusing unless all of the 3D geometry under them are also behind the focal plane.
BILD and VRML models
BILD format files are a simple way to specify arrows, spheres, cylinders, cones, boxes, points and lines. Chimera also supports the geometry subset of the VRML97 standard format.
Scale Bar
The Scale Bar (Higher-Order Structure) tool allows you to position a scale bar in the picture. Since it is a 3D object in the focal plane, you need to move it so it isn't obscured.
Color Key
The Color Key (Utilities) tool. Also integrated with Surface Color tool.

Exercises

Chimera comes with several image tutorials in the User's Guide. The tutorials combine learning about using chimera interactively and creating images.

Another exercise for creating images with transparent backgrounds is here.