<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=David80</id>
	<title>PyMOL Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=David80"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php/Special:Contributions/David80"/>
	<updated>2026-05-14T19:46:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Png&amp;diff=9194</id>
		<title>Png</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Png&amp;diff=9194"/>
		<updated>2010-03-16T11:01:25Z</updated>

		<summary type="html">&lt;p&gt;David80: /* DPI Setting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
'''png''' writes a png format image file of the current image to disk.&lt;br /&gt;
&lt;br /&gt;
===USAGE===&lt;br /&gt;
 png filename, dpi, ray&lt;br /&gt;
&lt;br /&gt;
* '''dpi''', sets the dots per inch (dpi) of the final image&lt;br /&gt;
* '''ray''', whether or not PyMOL ray traces the image before saving&lt;br /&gt;
&lt;br /&gt;
===PYMOL API===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cmd.png( string file, dpi, ray )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===COMMENTS===&lt;br /&gt;
&lt;br /&gt;
====Blank Screen Shots====&lt;br /&gt;
If, when you execute the [[Png]] command, you get blank images, you may have to [[Ray]] trace your image first, before running the [[Png]] command.  This occurs when there is no device context for the image, such as when running PyMOL in quiet gui-less mode.  If the ray tracing is taking too long due to scene complexity or size, then please see the [[Ray]] page or search the wiki for information about making movies with PyMOL (there are many ways to [[:Category:Performance|speed]] up rendering).&lt;br /&gt;
&lt;br /&gt;
====Transparent Backgrounds====&lt;br /&gt;
See [[Ray_opaque_background]].  This is very useful for presentations, or images that are placed on top of a background of nonuniform color, or if you simply want a transparent background for your images.&lt;br /&gt;
&lt;br /&gt;
====DPI Setting====&lt;br /&gt;
Use the DPI option to have PyMol set the DPI of your image.  If I execute &lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;ray 1200,1200&amp;lt;/source&amp;gt;&lt;br /&gt;
then execute &lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;png /tmp/ex.png, dpi=300&amp;lt;/source&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
====External links====&lt;br /&gt;
* [http://www.bestdissertation.com/services/thesis.html thesis]&lt;br /&gt;
&lt;br /&gt;
[[Category:Commands|Png]]&lt;br /&gt;
[[Category:Publication_Quality|Png]]&lt;br /&gt;
[[Category:Performance|Png]]&lt;/div&gt;</summary>
		<author><name>David80</name></author>
	</entry>
</feed>