HOME  

  ABOUT ME  

  :: PROJECTS ::  

  STUFF!  

  LINKS  

 

Projects

    HOME > PROJECTS > Zink


A program to generate attractive 'pen and ink' style protein diagrams.


Note: This version of Zink is fairly out of date now, I just haven't had time to sort it all out and update the software... sorry, some day soon... [BRS]

Introduction: Less is more!

Click for full sizeTired of all those overly ray-traced images of molecules? They can be very beautiful, and definitely have their place, but a more non-photorealistic approach can often give a much clearer image. You can find information about these techniques on the web and elsewhere, search for 'stylized', 'non-photorealistic', 'toon' or 'painterly' rendering. Non-photorealistic methods are used in many fields, particularly engineering, technical drawing and medicine, where clarity of illustration can be vital. Here's a good web page with many references and links. The work of David Goodsell is amoungst the best-known in the field of molecular visualisation, for example see his excellent PDB Molecule of the Month work (more info on this page).

Creating these artistic 'sketched-look' images is not trivial, despite the apparent simplicity of the end result. Most people seem to use commercial tools for this, hence I decided to reproduce the effects using free cross-platform software, and then automating the process within a new program, Zink. I tried to follow the same procedure as described in the above references, thats not to say you can't do it better or differently! In fact, since Zink is open-source software (GPL license) you can even change it yourself.

Zink uses PovRay for ray-tracing, and GIMP scripts for image composition, the exact methods are described later. Zink runs on Windows and most Unix/Linux platforms, but the beta test release is currently for Windows only. Zink is written in C++ using the Qt toolkit from TrollTech. Full references and acknowledgements can be found in the Help menu of the program.


Samples (Click to enlarge)

Click for full size Click for full size Click for full size

GroEL/GroES, PDB:1aon

As left, top view

PDB:2hmi


Click for full size Click for full size Click for full size

PDB:1aon

As left, chain colours

PDB:1krv


CLICK HERE to view a screenshot of the Windows version of Zink.


How does it work?

The method involves compositing three different images. The idea is to treat the colours, shadows, and edges seperately. First, a basic PovRay file is generated, which is then processed to generate each layer. A GIMP script (written in Schema) then does some filtering of the layers before compositing them together. The colours layer requires little change in the script, aside from contrast. The shadows layer is processed to reduce 'small' shadows, leaving just the main ones (this still needs work -- any ideas how to do it all in PovRay?). The lines layer requires most work. It starts of as a depth-map, where the shade of grey depends on the distance from the camera. There are at least two ways one can do this, for example accessing the z-buffer in openGL. I decided to use fog rendering in PovRay instead. Edge-detection is applied to this image, followed by some tweaking using basic image filters (posterisation etc). There are some extra options for line-thickening. The figure below shows the layers for GroEL/GroES (see Samples) before they get put through the GIMP script:


Download / Install / Usage

Zink is completely free! Since its in a beta testing phase, I've released the Windows version first. Click the link below to download the installer. Double-click the installer and follow the instructions (there are no special options to worry about. Admin permissions shouldn't be required). Please be aware of the license agreement before using Zink. The license text is shown in the installer and again in the Help menu of the program. Note also, Zink is not a standalone program, it requires a working copy of PovRay and GIMP in order to produce the final image (if you see empty images then check installation). GIMP requires GTK libraries. Knowledge of using PovRay and GIMP is useful but not required. The system requirements for Zink are mostly determined by your machines ability to process the Pov-Ray files, e.g. at least 128MB free RAM is recommended for very large proteins (tens of thousands of atoms). Similarly, very high image resolution settings will mean that GIMP needs large resources.

      zink_setup_1_0beta.exe (Windows installer, 1.7MB).

      zink_1_0beta_linux24.tar.gz (Linux 2.4.x binary+source, COMING SOON!).

Report bugs via email, see the Help, or my homepage. Note again, this is a beta release -- wait for version 1.0 (or linux port) if you want a smoother ride!

Currently there is no publication about Zink, but there might be in the future. You can credit use of Zink using the following text:
"Zink: A program to generate attractive 'pen and ink' style protein diagrams, Barry R Smith, (c) 2003."


Known Bugs, Problems, TODOs


Source code / compilation

Source is C++, using modified versions of some BTL code. Tested with MS Visual C++ 6 on Windows XP, GCC 2.9x and 3.2 on Linux (RedHat 7.3). Qt 2.3 or 3.x is required, with OpenGL module. Other compilers/platforms may require tweaking of code. Project (.pro) files for Tmake or Qmake are provided, from which you can generate the necessary dsp or Makefile. The source is divided into three folders (Zink, BBone, BTL3) and relative paths are used throughout. BBone is a standalone openGL viewer, Zink derives from its MainWindow class, and adds the wizard functionality. Note, some widgets use UI files since they were created using Qt Designer. Zink is GPL, but I'm happy to review code improvements which might be incorporated into the main code (and credit you accordingly).


Zink is released under the terms of the GPL license. This software is not supported
in any way by Birkbeck College or the Department of Crystallography.
© 2003