White background from O

White background from O

How it was made

This image was made as an example of how to quickly produce screen dumps from O, to print on paper or overheads, where a white background is needed. The problem is that if one simply changes the background colour in O, GL gets confused and still renders as though the background were black and so colours get washed out to nothing.

One way around this is to write out to an O-plot file, but then a lot of work has to be put into the macro that creates this, and badly-behaved slabs and limits have to be disciplined.

Another technique is to screen-capture and use image-processing software to change all the black background colour to white, but since foreground colours are generally chosen with a black background in mind (ie they are pale), and O's antialiasing routines fade to black, the result is horrible, like this.

So what we need to do is an inversion operation on the colours to maintain their relative intensities, but then we get a weird negative-like molecule. You could deliberately draw the molecule in negative colours to start with so that they come out right later, but this is kind of a pain, and the colours are never quite right, like this. But luckily, most IP programs have a hue-rotate function that will invert the colours again, whilst leaving the grey scale intact.
You're probably getting restless by now, but I think it was useful to explain the above. Anyway, this is how I made the image above :

I set up O in the normal way for viewing, and the screen was captured. I cropped and lassoed away distracting density fragments, and then perfomed an invert operation and used the HUE command to rotate the colours 180 degrees, so that they were back to normal except for the background, which is now white. I then set down the saturation of the yellows to get more easily printed greyish carbons, increased the contrast slightly, and printed.
Using The GIMP, I can convert my working O view in a decent overhead like this in a couple of minutes. The principles are the same for PhotoShop and other IP programs, but the functions may be harder to find.

The sequence in The GIMP is as follows :

(Run on 'gere' if you are at BMC in Uppsala, and 
use right-mouse within an image window to get the menu)

% gimp
Xtns-->ScreenShot {captures whole O window}
Tools-->Crop {crops out desired area}
Image-->Colors-->Invert {turns black background white}
Image-->Colors-->HueSaturation (click Master, Hue=180, OK) {restores other colours}
Image-->Colors-->HueSaturation (click Red, Saturation=-60, OK) {desaturates yellow}
Image-->Colors-->BrightnessContrast (drag contrast up) {gives denser printing}
Image-->Indexed {reduces RGB colours to indexed for gif output}
File-->SaveAs (myfile.gif) {saves to gif file}

% netscape (OpenFile myfile.gif, then print) {The safest way to print at BMC}

Voilà.

You can even print directly from The GIMP.

To speed up the invert and hue operations at BMC, try the script under :

ScriptFu-->MRH-->Oflip

Another tip :
To get nice fat bonds without resorting to sketch, you can draw the object twice, and scale up so that the area you are interested in fills the whole window (since scaling down later also scales down the width of the bonds). However, this technique also fattens up electron-density vectors, which can then look ugly.

Photoshop :
(a contribution from Edward Berry)
For those who haven't switched completely to open-source programs, and have Adobe Photoshop more readily available than Gimp, the photoshop instructions are:

1. Image:adjust:Invert (or control-I)
2. Image:adjust:Hue/Saturation (or ctrl-U) and type 180 in the first box HUE

(the order of these two steps is irrelevant)
This method is not ideal for rendered spheres and cylinder like sketch-stick and sketch-cpk, because the light highlights at the center of the sufaces come out dark.

Mark Harris, Feb '99

(Image Processing notes)

Counter