<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: split png image with sas in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326693#M11469</link>
    <description>&lt;P&gt;Well, yes, it is possible. &amp;nbsp;Depends if you have 6 months or so to write a parser for the filetype. &amp;nbsp;File format is given here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/Portable_Network_Graphics" target="_blank"&gt;https://en.wikipedia.org/wiki/Portable_Network_Graphics&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nothing stopping you form reading in the binary data, manipulating as you want, then writing out.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this a good idea, no. &amp;nbsp;Why are you attempting to use a picture? &amp;nbsp;Go back to the srouce data, and regenerate the output with the part you want. &amp;nbsp;Alternatively use a paint app as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;has said, however I personally see that as not being a good idea either, the whole picture would be there for a reason, chopping out a certain bit of it just removes most of the consolidating reference data. &amp;nbsp;Take for example a graph, the axis is there so the points have reference, you could chop out a bit, but does it still convey anything.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jan 2017 12:38:15 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-01-23T12:38:15Z</dc:date>
    <item>
      <title>split png image with sas</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326683#M11467</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;is it possible to split a single png image into two different png files with SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's say dividing a file IMAGE.png into&amp;nbsp;the upper 80% portion of the image and&amp;nbsp;the 20% on the bottom, saving them as TOP.png and BOTTOM.png, keeping the same resolution?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks, any hint appreciated,&lt;/P&gt;
&lt;P&gt;Scan&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 12:01:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326683#M11467</guid>
      <dc:creator>scan</dc:creator>
      <dc:date>2017-01-23T12:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: split png image with sas</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326687#M11468</link>
      <description>&lt;P&gt;SAS is really not an image manipulation utility. I'd suggest dedicated software like IrfanView, Potoshop or gimp for this.&lt;/P&gt;
&lt;P&gt;gimp should have something that can be used from the commandline.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 12:04:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326687#M11468</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-23T12:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: split png image with sas</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326693#M11469</link>
      <description>&lt;P&gt;Well, yes, it is possible. &amp;nbsp;Depends if you have 6 months or so to write a parser for the filetype. &amp;nbsp;File format is given here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/Portable_Network_Graphics" target="_blank"&gt;https://en.wikipedia.org/wiki/Portable_Network_Graphics&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nothing stopping you form reading in the binary data, manipulating as you want, then writing out.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this a good idea, no. &amp;nbsp;Why are you attempting to use a picture? &amp;nbsp;Go back to the srouce data, and regenerate the output with the part you want. &amp;nbsp;Alternatively use a paint app as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;has said, however I personally see that as not being a good idea either, the whole picture would be there for a reason, chopping out a certain bit of it just removes most of the consolidating reference data. &amp;nbsp;Take for example a graph, the axis is there so the points have reference, you could chop out a bit, but does it still convey anything.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 12:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326693#M11469</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-23T12:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: split png image with sas</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326702#M11471</link>
      <description>&lt;P&gt;Thank you all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to do it in SAS and no, unfortunately I don't have 6 months.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any workaround? As an example I think that probably it is possible trying to fit it in a smaller box, basically cutting the bottom side of the image. But what about the upper side?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 13:16:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326702#M11471</guid>
      <dc:creator>scan</dc:creator>
      <dc:date>2017-01-23T13:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: split png image with sas</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326704#M11473</link>
      <description>&lt;P&gt;Let's repeat: SAS does NOT have built-in image manipulation tools. Period. To manipulate an existing image, you would have to write that byte-by-byte yourself. Use a proper tool (easily available for all platforms, as mentioned) to do this.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 13:21:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326704#M11473</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-23T13:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: split png image with sas</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326705#M11474</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;have said, it's probably better to examine what you need for these images and try to build the graphs natively in SAS based on your data, rather than post-process the image.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;SGPLOT &lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2013/12/29/broken-axis/" target="_self"&gt;supports a "broken axis" that might help you to segment your report&lt;/A&gt;. &amp;nbsp;Otherwise, you might be able to build what you need in GTL. &amp;nbsp;You can start with the ODS Graphics Designer to build a layout with your data, which will generate the code that you can then process with PROC SGRENDER.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 13:32:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326705#M11474</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2017-01-23T13:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: split png image with sas</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326706#M11475</link>
      <description>&lt;P&gt;Please post your image so we can see what is in it. Also post the version of SAS that you are using.&lt;/P&gt;
&lt;P&gt;We can then suggest ways to produce output that might meet your business objectives.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 13:33:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326706#M11475</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-01-23T13:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: split png image with sas</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326772#M11478</link>
      <description>&lt;P&gt;Thanks for the interest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically I have a KM graph with patients at risk at the bottom.&lt;/P&gt;
&lt;P&gt;This is produced with a layout lattice with united datarange in order to align the two elements.&lt;/P&gt;
&lt;P&gt;I want to produce 2 different png mantaining the alignment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I solved for the moment creating 2 different png files with the same templating simply&amp;nbsp;changing the vertical dimension of the graph and assigning the row dimension to (0.99 0.01) to the km graph and&amp;nbsp;&lt;SPAN&gt;(0.01 0.99) to the second element with pt at risk.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I still have the labels of the second element creating a black box on the left bottom of the km graph, solved it whitening the text.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This is very dirty but works.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you have better hints on how to proceed I will be glad to accept them.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is there a way to delete the space between the border of the graph (max y-axis) and the border of the image (on the top)?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Because I'm actually having a lot of space between the first and second element.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I tried to define a style with&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc template;
define style NEWSTYLE;
parent = styles.listing ; 
replace Body from Document /
 bottommargin = 0 cm
 topmargin = 0 cm
 rightmargin = 0 cm
 leftmargin = 0 cm
 ;
 replace Body from Output /
 bottommargin = 0 cm
 topmargin = 0 cm
 rightmargin = 0 cm
 leftmargin = 0 cm
 ;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but it does not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm running on 9.4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Many thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Scan&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 16:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326772#M11478</guid>
      <dc:creator>scan</dc:creator>
      <dc:date>2017-01-23T16:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: split png image with sas</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326775#M11479</link>
      <description>&lt;P&gt;Let's repeat one more time. If you would like help, p&lt;SPAN&gt;lease post &lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt;Your image so we can see what is in it.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;The version of SAS that you are using.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;The SAS syntax and sample data would be especially welcome, especially&amp;nbsp;if the data is from a SASHelp data set or from the documentation.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 23 Jan 2017 16:47:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326775#M11479</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-01-23T16:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: split png image with sas</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326777#M11480</link>
      <description>&lt;P&gt;Thank you Rick,&lt;/P&gt;
&lt;P&gt;probably tomorrow I'll be free to adapt the code to a sashelp dataset.&lt;/P&gt;
&lt;P&gt;As you know I can't post code/datasets before making it completely generalised.&lt;/P&gt;
&lt;P&gt;Many thanks for the help so far, not only today.&lt;/P&gt;
&lt;P&gt;I'll return here with the requested things.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 16:50:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326777#M11480</guid>
      <dc:creator>scan</dc:creator>
      <dc:date>2017-01-23T16:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: split png image with sas</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326807#M11481</link>
      <description>&lt;P&gt;Instructions at &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; turn a dataset into data step code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It shouldn't be hard to obfuscate a few variables to demonstrate what you are doing.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 18:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326807#M11481</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-23T18:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: split png image with sas</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326855#M11482</link>
      <description>&lt;P&gt;Do you have the IML interface to R? &amp;nbsp;Can you call Python?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 21:23:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/326855#M11482</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-01-23T21:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: split png image with sas</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/327618#M11504</link>
      <description>&lt;P&gt;If you create your plots with SAS/GRAPH (proc gplot rather than proc sgplot), you can use proc greplay to put them back together as one plot,&amp;nbsp;positioning them as you like,&amp;nbsp;including overlapping to hide parts of some graphs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as I know, the SG procedures cannot output to catalog, and there is no proc sgreplay.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 02:14:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/split-png-image-with-sas/m-p/327618#M11504</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-01-26T02:14:18Z</dc:date>
    </item>
  </channel>
</rss>

