<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=Outline</id>
	<title>Outline - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=Outline"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Outline&amp;action=history"/>
	<updated>2026-04-11T23:45:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Outline&amp;diff=12077&amp;oldid=prev</id>
		<title>Bell: 6 revisions</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Outline&amp;diff=12077&amp;oldid=prev"/>
		<updated>2014-09-16T03:22:05Z</updated>

		<summary type="html">&lt;p&gt;6 revisions&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Outline = &lt;br /&gt;
&lt;br /&gt;
There is currently (as of PyMOL v.1.7) no way to outline a selection directly within PyMOL.  However, it can be accomplished indirectly with a composite image.&lt;br /&gt;
&lt;br /&gt;
== Relevant Settings ==&lt;br /&gt;
&lt;br /&gt;
* [[ray_opaque_background]]&lt;br /&gt;
* [[ray_trace_mode]]&lt;br /&gt;
* [[ray_trace_color]]&lt;br /&gt;
* [[ray_trace_gain]]&lt;br /&gt;
* [[surface_quality]]&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery heights=&amp;quot;320&amp;quot; widths=&amp;quot;320&amp;quot;&amp;gt;&lt;br /&gt;
Image:Outline_base.png|Structure of Cytochrome C (PDB 3cyt) shown in surface representation.&lt;br /&gt;
Image:Outline_overlay.png|Outline of residues within 2Å of Lys85 on chain I.  Notice the image background is transparent.&lt;br /&gt;
Image:Outline_composite.png|Composite of the previous 2 images.&lt;br /&gt;
Image:Outline_cleaned.png|The same composite image, cleaned up.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following script was used to generate the first two images from PyMOL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
bg_color white&lt;br /&gt;
&lt;br /&gt;
fetch 3cyt, async=0&lt;br /&gt;
&lt;br /&gt;
as surface&lt;br /&gt;
color marine&lt;br /&gt;
&lt;br /&gt;
select outline, br. chain I and resi 85 around 2&lt;br /&gt;
&lt;br /&gt;
set_view (\&lt;br /&gt;
     0.061975956,   -0.950684488,    0.303902954,\&lt;br /&gt;
     0.703773856,    0.257531703,    0.662103057,\&lt;br /&gt;
    -0.707715809,    0.172843516,    0.685028315,\&lt;br /&gt;
     0.000000000,    0.000000000, -152.244812012,\&lt;br /&gt;
    25.274658203,    8.288025856,    9.110867500,\&lt;br /&gt;
    51.143974304,  253.345642090,  -20.000000000 )&lt;br /&gt;
&lt;br /&gt;
png base.png, ray=1&lt;br /&gt;
&lt;br /&gt;
hide everything&lt;br /&gt;
as surface, outline&lt;br /&gt;
set ray_trace_mode, 2&lt;br /&gt;
set ray_trace_color, yellow&lt;br /&gt;
set ray_opaque_background, 0&lt;br /&gt;
&lt;br /&gt;
png overlay.png, ray=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an image editing program, position overlay.png in a layer exactly overlapping base.png.  The extra outline lines can also (optionally) be cleaned up by carefully erasing them using the graphics program's eraser tool.&lt;br /&gt;
&lt;br /&gt;
== Automation ==&lt;br /&gt;
&lt;br /&gt;
If you need to have a fully automated solution, you can use ImageMagick or GraphicMagick to do this. If you use ImageMagick in a Unix box, you can type this command on the terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
composite -gravity center overlay.png base.png composite.png&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [http://www.imagemagick.org/script/composite.php this page] on ImageMagick for more information. If you need to use it with GraphicMagick or in Windows or Mac, search for the relevant guidances.&lt;br /&gt;
&lt;br /&gt;
If you need to erase the lines inside the border, you can use the following command to do it.  The `color` variable is the desired final output color of the border; change the `width` variable to change the border's thickness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
infile=&amp;quot;overlay.png&amp;quot;&lt;br /&gt;
outfile=&amp;quot;overlay_cleaned.png&amp;quot;&lt;br /&gt;
color=&amp;quot;black&amp;quot;&lt;br /&gt;
width=3&lt;br /&gt;
w2=`convert $infile -format &amp;quot;%[fx:w-2]&amp;quot; info:`&lt;br /&gt;
h2=`convert $infile -format &amp;quot;%[fx:h-2]&amp;quot; info:`&lt;br /&gt;
&lt;br /&gt;
convert $infile -background white -flatten -fill black +opaque white -bordercolor none -border 2 \&lt;br /&gt;
-fill none -draw &amp;quot;matte 2,2 floodfill matte $w2,2 floodfill matte $w2,$h2 floodfill matte 2,$h2 floodfill&amp;quot; \&lt;br /&gt;
-fill white +opaque none -fill black -opaque none \&lt;br /&gt;
-alpha off -morphology edge octagon:$width \&lt;br /&gt;
-channel rgba -fill none +opaque white -fill $color -opaque white -shave 2x2 $outfile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&amp;amp;t=25970&amp;amp;p=113686#p113686 this thread] in ImageMagick forum for more detail.&lt;/div&gt;</summary>
		<author><name>Bell</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Outline&amp;diff=12074&amp;oldid=prev</id>
		<title>Jaredsampson: /* Example */ added &quot;Automation&quot; heading.  Added `outfile` variable in imagemagick script, and adjusted filenames for consistency.</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Outline&amp;diff=12074&amp;oldid=prev"/>
		<updated>2014-07-28T17:08:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Example: &lt;/span&gt; added &amp;quot;Automation&amp;quot; heading.  Added `outfile` variable in imagemagick script, and adjusted filenames for consistency.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Outline = &lt;br /&gt;
&lt;br /&gt;
There is currently (as of PyMOL v.1.7) no way to outline a selection directly within PyMOL.  However, it can be accomplished indirectly with a composite image.&lt;br /&gt;
&lt;br /&gt;
== Relevant Settings ==&lt;br /&gt;
&lt;br /&gt;
* [[ray_opaque_background]]&lt;br /&gt;
* [[ray_trace_mode]]&lt;br /&gt;
* [[ray_trace_color]]&lt;br /&gt;
* [[ray_trace_gain]]&lt;br /&gt;
* [[surface_quality]]&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery heights=&amp;quot;320&amp;quot; widths=&amp;quot;320&amp;quot;&amp;gt;&lt;br /&gt;
Image:Outline_base.png|Structure of Cytochrome C (PDB 3cyt) shown in surface representation.&lt;br /&gt;
Image:Outline_overlay.png|Outline of residues within 2Å of Lys85 on chain I.  Notice the image background is transparent.&lt;br /&gt;
Image:Outline_composite.png|Composite of the previous 2 images.&lt;br /&gt;
Image:Outline_cleaned.png|The same composite image, cleaned up.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following script was used to generate the first two images from PyMOL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
bg_color white&lt;br /&gt;
&lt;br /&gt;
fetch 3cyt, async=0&lt;br /&gt;
&lt;br /&gt;
as surface&lt;br /&gt;
color marine&lt;br /&gt;
&lt;br /&gt;
select outline, br. chain I and resi 85 around 2&lt;br /&gt;
&lt;br /&gt;
set_view (\&lt;br /&gt;
     0.061975956,   -0.950684488,    0.303902954,\&lt;br /&gt;
     0.703773856,    0.257531703,    0.662103057,\&lt;br /&gt;
    -0.707715809,    0.172843516,    0.685028315,\&lt;br /&gt;
     0.000000000,    0.000000000, -152.244812012,\&lt;br /&gt;
    25.274658203,    8.288025856,    9.110867500,\&lt;br /&gt;
    51.143974304,  253.345642090,  -20.000000000 )&lt;br /&gt;
&lt;br /&gt;
png base.png, ray=1&lt;br /&gt;
&lt;br /&gt;
hide everything&lt;br /&gt;
as surface, outline&lt;br /&gt;
set ray_trace_mode, 2&lt;br /&gt;
set ray_trace_color, yellow&lt;br /&gt;
set ray_opaque_background, 0&lt;br /&gt;
&lt;br /&gt;
png overlay.png, ray=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an image editing program, position overlay.png in a layer exactly overlapping base.png.  The extra outline lines can also (optionally) be cleaned up by carefully erasing them using the graphics program's eraser tool.&lt;br /&gt;
&lt;br /&gt;
== Automation ==&lt;br /&gt;
&lt;br /&gt;
If you need to have a fully automated solution, you can use ImageMagick or GraphicMagick to do this. If you use ImageMagick in a Unix box, you can type this command on the terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
composite -gravity center overlay.png base.png composite.png&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [http://www.imagemagick.org/script/composite.php this page] on ImageMagick for more information. If you need to use it with GraphicMagick or in Windows or Mac, search for the relevant guidances.&lt;br /&gt;
&lt;br /&gt;
If you need to erase the lines inside the border, you can use the following command to do it.  The `color` variable is the desired final output color of the border.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
infile=&amp;quot;overlay.png&amp;quot;&lt;br /&gt;
outfile=&amp;quot;overlay_cleaned.png&amp;quot;&lt;br /&gt;
color=&amp;quot;black&amp;quot;&lt;br /&gt;
w2=`convert $infile -format &amp;quot;%[fx:w-2]&amp;quot; info:`&lt;br /&gt;
h2=`convert $infile -format &amp;quot;%[fx:h-2]&amp;quot; info:`&lt;br /&gt;
convert $infile -background white -flatten -fill black +opaque white -bordercolor black -border 1 \&lt;br /&gt;
-fill none -draw &amp;quot;matte 2,2 floodfill matte $w2,2 floodfill matte $w2,$h2 floodfill matte 2,$h2 floodfill&amp;quot; \&lt;br /&gt;
-fill white +opaque none -fill black -opaque none \&lt;br /&gt;
-alpha off -morphology edgein octagon:3 \&lt;br /&gt;
-channel rgba -fill none +opaque white -fill $color -opaque white -shave 1x1 $outfile&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&amp;amp;t=25970&amp;amp;p=113686#p113686 this thread] in ImageMagick forum for more detail.&lt;/div&gt;</summary>
		<author><name>Jaredsampson</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Outline&amp;diff=12071&amp;oldid=prev</id>
		<title>Jaredsampson: Created page</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Outline&amp;diff=12071&amp;oldid=prev"/>
		<updated>2014-07-24T16:51:50Z</updated>

		<summary type="html">&lt;p&gt;Created page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Outline = &lt;br /&gt;
&lt;br /&gt;
There is currently (as of PyMOL v.1.7) no way to outline a selection directly within PyMOL.  However, it can be accomplished indirectly with a composite image.&lt;br /&gt;
&lt;br /&gt;
== Relevant Settings ==&lt;br /&gt;
&lt;br /&gt;
* [[ray_opaque_background]]&lt;br /&gt;
* [[ray_trace_mode]]&lt;br /&gt;
* [[ray_trace_color]]&lt;br /&gt;
* [[ray_trace_gain]]&lt;br /&gt;
* [[surface_quality]]&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery heights=&amp;quot;320&amp;quot; widths=&amp;quot;320&amp;quot;&amp;gt;&lt;br /&gt;
Image:Outline_base.png|Structure of Cytochrome C (PDB 3cyt) shown in surface representation.&lt;br /&gt;
Image:Outline_overlay.png|Outline of residues within 2Å of Lys85 on chain I.  Notice the image background is transparent.&lt;br /&gt;
Image:Outline_composite.png|Composite of the previous 2 images.&lt;br /&gt;
Image:Outline_cleaned.png|The same composite image, cleaned up.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following script was used to generate the first two images from PyMOL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
bg_color white&lt;br /&gt;
&lt;br /&gt;
fetch 3cyt, async=0&lt;br /&gt;
&lt;br /&gt;
as surface&lt;br /&gt;
color marine&lt;br /&gt;
&lt;br /&gt;
select outline, br. chain I and resi 85 around 2&lt;br /&gt;
&lt;br /&gt;
set_view (\&lt;br /&gt;
     0.061975956,   -0.950684488,    0.303902954,\&lt;br /&gt;
     0.703773856,    0.257531703,    0.662103057,\&lt;br /&gt;
    -0.707715809,    0.172843516,    0.685028315,\&lt;br /&gt;
     0.000000000,    0.000000000, -152.244812012,\&lt;br /&gt;
    25.274658203,    8.288025856,    9.110867500,\&lt;br /&gt;
    51.143974304,  253.345642090,  -20.000000000 )&lt;br /&gt;
&lt;br /&gt;
png base.png, ray=1&lt;br /&gt;
&lt;br /&gt;
hide everything&lt;br /&gt;
as surface, outline&lt;br /&gt;
set ray_trace_mode, 2&lt;br /&gt;
set ray_trace_color, yellow&lt;br /&gt;
set ray_opaque_background, 0&lt;br /&gt;
&lt;br /&gt;
png overlay.png, ray=1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an image editing program, position overlay.png in a layer exactly overlapping base.png.  The extra outline lines can also (optionally) be cleaned up by carefully erasing them using the graphics program's eraser tool.&lt;/div&gt;</summary>
		<author><name>Jaredsampson</name></author>
	</entry>
</feed>