Png

From PyMOLWiki
(Redirected from Cmd png)
Jump to: navigation, search

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

Contents

Usage

png filename[, width[, height[, dpi[, ray[, quiet]]]]]

Example

png ~/Desktop/test.png, width=10cm, dpi=300, ray=1

PyMOL API

cmd.png(string filename, int width=0, int height=0, float dpi=-1, int ray=0, int quiet=0)

Comments

Transparent Backgrounds

Use the `ray_opaque_background` setting to output images with transparent backgrounds.

set ray_opaque_background, 0

This can be useful for presentations, images that are placed on top of a background of nonuniform color (e.g. gradients), and images that overlap text or other images.

DPI Setting

Use the DPI option to have PyMol set the DPI of your image. Executing the command

png /tmp/ex.png, width=1200, height=1200, dpi=300, ray=1

will ouput a four-inch square image at 300dpi. Leaving off the dpi parameter would yield a 1200x1200 image at your system's default pixel density (e.g. 72 or 96 dpi). This saves the intermediate step of having to use GIMP/PhotoShop/etc to rescale your photos for publication.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox