<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235665</link>
    <title>MATLAB Central Newsreader - Saving a overlay and image figure</title>
    <description>Feed for thread: Saving a overlay and image figure</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sun, 07 Sep 2008 21:10:19 -0400</pubDate>
      <title>Saving a overlay and image figure</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235665#599154</link>
      <author>Nicholas Beser</author>
      <description>I was able to create a very large image with a line overlay in MATLAB 2008a. I tried to use getimage to retrieve the combination of image and line overlay, however the function only returned the image (no line art). &lt;br&gt;
&lt;br&gt;
Here is the code fragment:&lt;br&gt;
h=imshow(imgtest,'XData',XData,'YData',YData);title(frmstr1);&lt;br&gt;
hold on&lt;br&gt;
for k=2:frmcnt&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xl=[pointlist(1,k-1) pointlist(1,k)];&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;yl=[pointlist(2,k-1) pointlist(2,k)];&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;plot(xl,yl,'Color','b');&lt;br&gt;
end&lt;br&gt;
Anewimg=getimage(h);&lt;br&gt;
hold off&lt;br&gt;
&lt;br&gt;
Is there some other function that I should use to save the entire figure to a graphics file (such as PNG or JPG)? While I can manually save the figure as a jpg, it is not saved at the full resolution, only at display resolution. Since the display is at 17%, that is not sufficient.&lt;br&gt;
&lt;br&gt;
Thank-you,&lt;br&gt;
&lt;br&gt;
Nick Beser&lt;br&gt;
nick.beser@jhuapl.edu</description>
    </item>
    <item>
      <pubDate>Mon, 08 Sep 2008 00:53:23 -0400</pubDate>
      <title>Re: Saving a overlay and image figure</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235665#599172</link>
      <author>Mars creature</author>
      <description>On Sep 7, 5:10 pm, &quot;Nicholas Beser&quot; &amp;lt;nick.be...@jhuapl.edu&amp;gt; wrote:&lt;br&gt;
&amp;gt; I was able to create a very large image with a line overlay in MATLAB 2008a. I tried to use getimage to retrieve the combination of image and line overlay, however the function only returned the image (no line art).&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Here is the code fragment:&lt;br&gt;
&amp;gt; h=imshow(imgtest,'XData',XData,'YData',YData);title(frmstr1);&lt;br&gt;
&amp;gt; hold on&lt;br&gt;
&amp;gt; for k=2:frmcnt&lt;br&gt;
&amp;gt;     xl=[pointlist(1,k-1) pointlist(1,k)];&lt;br&gt;
&amp;gt;     yl=[pointlist(2,k-1) pointlist(2,k)];&lt;br&gt;
&amp;gt;     plot(xl,yl,'Color','b');&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; Anewimg=getimage(h);&lt;br&gt;
&amp;gt; hold off&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Is there some other function that I should use to save the entire figure to a graphics file (such as PNG or JPG)? While I can manually save the figure as a jpg, it is not saved at the full resolution, only at display resolution. Since the display is at 17%, that is not sufficient.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thank-you,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Nick Beser&lt;br&gt;
&amp;gt; nick.be...@jhuapl.edu&lt;br&gt;
&lt;br&gt;
Not sure if it works for you.&lt;br&gt;
You can use 'print' to save the figure to a graphic file, such as&lt;br&gt;
jpg,eps etc. 300dpi (-r300) should be enough to have a nice printout.&lt;br&gt;
Jinbo</description>
    </item>
    <item>
      <pubDate>Mon, 08 Sep 2008 14:17:01 -0400</pubDate>
      <title>Re: Saving a overlay and image figure</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235665#599272</link>
      <author>Nicholas Beser</author>
      <description>Thank-you for your reply. I guess I did not make the problem clear. I know I can save the figure, but it saves it at the screen resolution (1200x900). The native resolution of the mosaic was 5300x1500. While I can save the basic image obtained by getImage, the overlay is not retrieved with getImage. &lt;br&gt;
&lt;br&gt;
I saw on a earlier post, someone had asked Steve Eddings the same question, and was told to call the technical support. That was about a year ago.&lt;br&gt;
&lt;br&gt;
Nick&lt;br&gt;
&lt;br&gt;
Mars creature &amp;lt;jinbow@gmail.com&amp;gt; wrote in message &amp;lt;5c654054-d26c-4cf3-9865-171a56e230ad@p25g2000hsf.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Sep 7, 5:10 pm, &quot;Nicholas Beser&quot; &amp;lt;nick.be...@jhuapl.edu&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; I was able to create a very large image with a line overlay in MATLAB 2008a. I tried to use getimage to retrieve the combination of image and line overlay, however the function only returned the image (no line art).&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Here is the code fragment:&lt;br&gt;
&amp;gt; &amp;gt; h=imshow(imgtest,'XData',XData,'YData',YData);title(frmstr1);&lt;br&gt;
&amp;gt; &amp;gt; hold on&lt;br&gt;
&amp;gt; &amp;gt; for k=2:frmcnt&lt;br&gt;
&amp;gt; &amp;gt;     xl=[pointlist(1,k-1) pointlist(1,k)];&lt;br&gt;
&amp;gt; &amp;gt;     yl=[pointlist(2,k-1) pointlist(2,k)];&lt;br&gt;
&amp;gt; &amp;gt;     plot(xl,yl,'Color','b');&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; Anewimg=getimage(h);&lt;br&gt;
&amp;gt; &amp;gt; hold off&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Is there some other function that I should use to save the entire figure to a graphics file (such as PNG or JPG)? While I can manually save the figure as a jpg, it is not saved at the full resolution, only at display resolution. Since the display is at 17%, that is not sufficient.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Thank-you,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Nick Beser&lt;br&gt;
&amp;gt; &amp;gt; nick.be...@jhuapl.edu&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Not sure if it works for you.&lt;br&gt;
&amp;gt; You can use 'print' to save the figure to a graphic file, such as&lt;br&gt;
&amp;gt; jpg,eps etc. 300dpi (-r300) should be enough to have a nice printout.&lt;br&gt;
&amp;gt; Jinbo</description>
    </item>
    <item>
      <pubDate>Mon, 08 Sep 2008 17:45:16 -0400</pubDate>
      <title>Re: Saving a overlay and image figure</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235665#599328</link>
      <author>ImageAnalyst</author>
      <description>On Sep 7, 5:10=A0pm, &quot;Nicholas Beser&quot; &amp;lt;nick.be...@jhuapl.edu&amp;gt; wrote:&lt;br&gt;
&amp;gt; I was able to create a very large image with a line overlay in MATLAB 200=&lt;br&gt;
8a. I tried to use getimage to retrieve the combination of image and line o=&lt;br&gt;
verlay, however the function only returned the image (no line art).&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Here is the code fragment:&lt;br&gt;
&amp;gt; h=3Dimshow(imgtest,'XData',XData,'YData',YData);title(frmstr1);&lt;br&gt;
&amp;gt; hold on&lt;br&gt;
&amp;gt; for k=3D2:frmcnt&lt;br&gt;
&amp;gt; =A0 =A0 xl=3D[pointlist(1,k-1) pointlist(1,k)];&lt;br&gt;
&amp;gt; =A0 =A0 yl=3D[pointlist(2,k-1) pointlist(2,k)];&lt;br&gt;
&amp;gt; =A0 =A0 plot(xl,yl,'Color','b');&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; Anewimg=3Dgetimage(h);&lt;br&gt;
&amp;gt; hold off&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Is there some other function that I should use to save the entire figure =&lt;br&gt;
to a graphics file (such as PNG or JPG)? While I can manually save the figu=&lt;br&gt;
re as a jpg, it is not saved at the full resolution, only at display resolu=&lt;br&gt;
tion. Since the display is at 17%, that is not sufficient.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thank-you,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Nick Beser&lt;br&gt;
&amp;gt; nick.be...@jhuapl.edu&lt;br&gt;
&lt;br&gt;
-----------------------------------------------------------------&lt;br&gt;
Good question and I don't think I've seen a satisfactory answer yet.&lt;br&gt;
I think there's some sort of incompatibility between how it draws&lt;br&gt;
overlay graphics and the underlying pixel based bitmap.  As you know&lt;br&gt;
the image may display on screen in the little axes which will have a&lt;br&gt;
completely different number of pixels on your screen than in the&lt;br&gt;
underlying pixel image.  And the graphics are drawn to fit in this&lt;br&gt;
screen image.  The methods I've seen all produce saved images that are&lt;br&gt;
different dimensions than your original image (for example, the other&lt;br&gt;
responses to your question).&lt;br&gt;
Still looking for what we really want. . . . . . .&lt;br&gt;
ImageAnalyst</description>
    </item>
    <item>
      <pubDate>Mon, 08 Sep 2008 19:06:02 -0400</pubDate>
      <title>Re: Saving a overlay and image figure</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235665#599349</link>
      <author>Joaquim Luis</author>
      <description>ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;cf49d90b-baef-42bc-a5ad-36ffd3282dcd@d45g2000hsc.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Sep 7, 5:10=A0pm, &quot;Nicholas Beser&quot; &amp;lt;nick.be...@jhuapl.edu&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; I was able to create a very large image with a line overlay in MATLAB 200=&lt;br&gt;
&amp;gt; 8a. I tried to use getimage to retrieve the combination of image and line o=&lt;br&gt;
&amp;gt; verlay, however the function only returned the image (no line art).&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Here is the code fragment:&lt;br&gt;
&amp;gt; &amp;gt; h=3Dimshow(imgtest,'XData',XData,'YData',YData);title(frmstr1);&lt;br&gt;
&amp;gt; &amp;gt; hold on&lt;br&gt;
&amp;gt; &amp;gt; for k=3D2:frmcnt&lt;br&gt;
&amp;gt; &amp;gt; =A0 =A0 xl=3D[pointlist(1,k-1) pointlist(1,k)];&lt;br&gt;
&amp;gt; &amp;gt; =A0 =A0 yl=3D[pointlist(2,k-1) pointlist(2,k)];&lt;br&gt;
&amp;gt; &amp;gt; =A0 =A0 plot(xl,yl,'Color','b');&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; Anewimg=3Dgetimage(h);&lt;br&gt;
&amp;gt; &amp;gt; hold off&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Is there some other function that I should use to save the entire figure =&lt;br&gt;
&amp;gt; to a graphics file (such as PNG or JPG)? While I can manually save the figu=&lt;br&gt;
&amp;gt; re as a jpg, it is not saved at the full resolution, only at display resolu=&lt;br&gt;
&amp;gt; tion. Since the display is at 17%, that is not sufficient.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Thank-you,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Nick Beser&lt;br&gt;
&amp;gt; &amp;gt; nick.be...@jhuapl.edu&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -----------------------------------------------------------------&lt;br&gt;
&amp;gt; Good question and I don't think I've seen a satisfactory answer yet.&lt;br&gt;
&amp;gt; I think there's some sort of incompatibility between how it draws&lt;br&gt;
&amp;gt; overlay graphics and the underlying pixel based bitmap.  As you know&lt;br&gt;
&amp;gt; the image may display on screen in the little axes which will have a&lt;br&gt;
&amp;gt; completely different number of pixels on your screen than in the&lt;br&gt;
&amp;gt; underlying pixel image.  And the graphics are drawn to fit in this&lt;br&gt;
&amp;gt; screen image.  The methods I've seen all produce saved images that are&lt;br&gt;
&amp;gt; different dimensions than your original image (for example, the other&lt;br&gt;
&amp;gt; responses to your question).&lt;br&gt;
&amp;gt; Still looking for what we really want. . . . . . .&lt;br&gt;
&amp;gt; ImageAnalyst&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Hi,&lt;br&gt;
It was for these and other reason that I created the IMCAPTURE. Some &quot;clients&quot; seam to be happy with it as well.&lt;br&gt;
www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=13355&amp;objectType=FILE&lt;br&gt;
&lt;br&gt;
J. Luis</description>
    </item>
    <item>
      <pubDate>Mon, 08 Sep 2008 19:55:03 -0400</pubDate>
      <title>Re: Saving a overlay and image figure</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235665#599356</link>
      <author>Nicholas Beser</author>
      <description>&quot;Joaquim Luis&quot; &amp;lt;jluis@--ualg--.pt&amp;gt; wrote in message &amp;lt;ga3t2q$7l7$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;cf49d90b-baef-42bc-a5ad-36ffd3282dcd@d45g2000hsc.googlegroups.com&amp;gt;...&lt;br&gt;
&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; It was for these and other reason that I created the IMCAPTURE. Some &quot;clients&quot; seam to be happy with it as well.&lt;br&gt;
&amp;gt; www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=13355&amp;objectType=FILE&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; J. Luis&lt;br&gt;
&lt;br&gt;
Joaquim,&lt;br&gt;
&lt;br&gt;
Thank-you. Your code did the trick. I did notice that the overlay plot was interpolated up to a very thick line (but the results are quite satisfactory). I think it is due to the scaling that was done when the figure was created (17% scale).&lt;br&gt;
&lt;br&gt;
Nick</description>
    </item>
    <item>
      <pubDate>Mon, 08 Sep 2008 22:40:18 -0400</pubDate>
      <title>Re: Saving a overlay and image figure</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235665#599375</link>
      <author>Joaquim Luis</author>
      <description>&quot;Nicholas Beser&quot; &amp;lt;nick.beser@jhuapl.edu&amp;gt; wrote in message &amp;lt;ga3vun$cn2$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Joaquim Luis&quot; &amp;lt;jluis@--ualg--.pt&amp;gt; wrote in message &amp;lt;ga3t2q$7l7$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;cf49d90b-baef-42bc-a5ad-36ffd3282dcd@d45g2000hsc.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Hi,&lt;br&gt;
&amp;gt; &amp;gt; It was for these and other reason that I created the IMCAPTURE. Some &quot;clients&quot; seam to be happy with it as well.&lt;br&gt;
&amp;gt; &amp;gt; www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=13355&amp;objectType=FILE&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; J. Luis&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Joaquim,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thank-you. Your code did the trick. I did notice that the overlay plot was interpolated up to a very thick line (but the results are quite satisfactory). I think it is due to the scaling that was done when the figure was created (17% scale).&lt;br&gt;
&lt;br&gt;
Humm... I see, but there is nothing we can do about it. The screen capture process is beyond control.&lt;br&gt;
&lt;br&gt;
Joaquim </description>
    </item>
    <item>
      <pubDate>Tue, 09 Sep 2008 03:53:02 -0400</pubDate>
      <title>Re: Saving a overlay and image figure</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235665#599400</link>
      <author>Alan B</author>
      <description>Its not ideal, but you could write your own line-drawing function and just write black points directly into the array, then imwrite. Line drawing isn't too hard, and you can easily transform coordinates from data-space to pixel-space. Lacking a better solution, this would certainly work, which is better than the alternative.</description>
    </item>
    <item>
      <pubDate>Tue, 09 Sep 2008 05:10:20 -0400</pubDate>
      <title>Re: Saving a overlay and image figure</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/235665#599404</link>
      <author>Shanmugam Kannappan</author>
      <description>Hello Sir,&lt;br&gt;
getimage command will not work out for getting the content of the figure window.&lt;br&gt;
&lt;br&gt;
I suggest that u can use getframe command.The example code as below.&lt;br&gt;
&lt;br&gt;
imshow('pout.tif')&lt;br&gt;
hold on&lt;br&gt;
plot(1:260,150)&lt;br&gt;
s=getframe;&lt;br&gt;
figure&lt;br&gt;
imshow(s.cdata)&lt;br&gt;
&lt;br&gt;
Regards&lt;br&gt;
&lt;br&gt;
Shanmugam.K&lt;br&gt;
&lt;br&gt;
&quot;Nicholas Beser&quot; &amp;lt;nick.beser@jhuapl.edu&amp;gt; wrote in message &amp;lt;ga1fvr$4em$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I was able to create a very large image with a line overlay in MATLAB 2008a. I tried to use getimage to retrieve the combination of image and line overlay, however the function only returned the image (no line art). &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Here is the code fragment:&lt;br&gt;
&amp;gt; h=imshow(imgtest,'XData',XData,'YData',YData);title(frmstr1);&lt;br&gt;
&amp;gt; hold on&lt;br&gt;
&amp;gt; for k=2:frmcnt&lt;br&gt;
&amp;gt;     xl=[pointlist(1,k-1) pointlist(1,k)];&lt;br&gt;
&amp;gt;     yl=[pointlist(2,k-1) pointlist(2,k)];&lt;br&gt;
&amp;gt;     plot(xl,yl,'Color','b');&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; Anewimg=getimage(h);&lt;br&gt;
&amp;gt; hold off&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Is there some other function that I should use to save the entire figure to a graphics file (such as PNG or JPG)? While I can manually save the figure as a jpg, it is not saved at the full resolution, only at display resolution. Since the display is at 17%, that is not sufficient.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thank-you,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Nick Beser&lt;br&gt;
&amp;gt; nick.beser@jhuapl.edu</description>
    </item>
  </channel>
</rss>

