Png: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
(New comment about transparent png's)
No edit summary
Line 3: Line 3:


===USAGE===
===USAGE===
  png filename
  png filename, dpi


===PYMOL API===
===PYMOL API===
<source lang="python">
<source lang="python">
cmd.png( string file )
cmd.png( string file, dpi )
</source>
</source>


===COMMENTS===
===COMMENTS===
====Transparent Backgrounds====
To obtain transparent png images, use the following command before ray-tracing and exporting your scene:
To obtain transparent png images, use the following command before ray-tracing and exporting your scene:
set ray_opaque_background, 0
<source lang="python">set ray_opaque_background, 0</source>
 
====DPI Setting====
Use the DPI option to have PyMol set the DPI of your image.  If I execute
<source lang="python">ray 1200,1200</source>
then execute
<source lang="python">png /tmp/ex.png, dpi=300</source>
I will get a four-inch square image at 300dpi.  Leaving off the '''dpi''' flag would net me a 1200x1200 image at 72dpi.  This saves the intermediate step of having to use GIMP/PhotoShop/etc to rescale your photos for publication.


[[Category:Commands|png]]
[[Category:Commands|png]]

Revision as of 20:07, 4 October 2006

DESCRIPTION

png writes a png format image file of the current image to disk.

USAGE

png filename, dpi

PYMOL API

cmd.png( string file, dpi )

COMMENTS

Transparent Backgrounds

To obtain transparent png images, use the following command before ray-tracing and exporting your scene:

set ray_opaque_background, 0

DPI Setting

Use the DPI option to have PyMol set the DPI of your image. If I execute

ray 1200,1200

then execute

png /tmp/ex.png, dpi=300

I will get a four-inch square image at 300dpi. Leaving off the dpi flag would net me a 1200x1200 image at 72dpi. This saves the intermediate step of having to use GIMP/PhotoShop/etc to rescale your photos for publication.