How to wrap textures around crystal structures – the lazy way

Here I will give a very rough guide on how to wrap, or rather overlay, an image onto the surface of a molecule using PhotoShop CS5 and PyMol. You should end with something like this:


Side-by-side comparison of the danish flag wrapped around either a ray-traced (Right) or a not ray-traced (left) model of the 20S proteasome.
Side-by-side comparison of the danish flag wrapped around either a ray-traced (Right) or a not ray-traced (left) model of the 20S proteasome.

The Simpsons

Homer wraped on a ray-traced model of 20S proteasome
Marge wrapped on a ray-traced model of 20S proteasome

My original inspiration to playing around with textures on surfaces was from this youtube tutorial.  Although the video is pretty awful and waaaay to long it does however (eventually) show you how to do it and I respect the authors willingness to share. Below I have very roughly summarized how to create the effect yourself.

  1. Find the PDB code of the crystal structure you desire to wrap a texture around. I used one of the crystal structures of the 20S proteasome because it looks like a big canvas and it is easy to use. I have also used ribosome structures and other large molecules, but they may require more work before they are usable.
  2. In PyMol use the fetch command together with PDB code you found in step 1 to load the model into PyMol.
  3. Display the model with surface representation by typing “show surface”
  4. Change the color to e.g. a light grey color by typing “color grey50” or to whatever color you want.
  5. In PyMol set the background to transparent by turning opaque background off using “set opaque_background, off”
  6. Find an orientation you like and write out a PNG by typing “png structure.png, dpi=300”. This will save the png file to the current directory. (optional: raytrace the image before saving it)
  7. By using googles image search  find a suitable motiv you want to wrap around /onto the structure, like the flag I used above. Save the image e.g.  as flag.png.
  8. Open flag.png in a tab in PhotoShop and structure.png in another tab.
  9. Copy/paste the flag motiv into the structure tab. (<ctrl-A>, <ctrl-C>, change tab, <ctrl-V>)
  10. Scale the flag motive to cover the structure. (Click select flag, <ctrl-t>, drag at corners until it covers what you want of the structure, <enter>.
  11. Now while holding down Ctrl click on the layer containing the structure and you should see it outlined behind the flag.
  12. Now add the structure layer as a layer mask to the flag layer (I know it sounds confusing).
  13. Now pick a blending mode , I normally use the overlay mode or the hard/soft light mode.
  14. You are basically  done now and if everything went like planed you will have something like the above figures. If not try again!


Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/molecularart.dk/public_html/wp-includes/class-wp-comment-query.php on line 405

Leave a Reply

Your email address will not be published. Required fields are marked *