<?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: Any options to create a compressed or smaller animated GIF ? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Any-options-to-create-a-compressed-or-smaller-animated-GIF/m-p/663438#M20099</link>
    <description>Yeah. as Reeza said, Try option dpi=200  .</description>
    <pubDate>Fri, 19 Jun 2020 11:42:42 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2020-06-19T11:42:42Z</dc:date>
    <item>
      <title>Any options to create a compressed or smaller animated GIF ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Any-options-to-create-a-compressed-or-smaller-animated-GIF/m-p/663234#M20095</link>
      <description>&lt;P&gt;Consider this program that creates an animated gif.&amp;nbsp; The file size is ~1.25MB&lt;/P&gt;
&lt;P&gt;It can be compressed about 83% by external processes (&lt;A href="https://gifcompressor.com/" target="_blank"&gt;https://gifcompressor.com/&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are there any SAS options for directly creating a compressed anim gif ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Program&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;data have;
  do angle = 0 to 1080 by 15;
    theta = 2 * constant('PI') / 360 * angle;
    r = theta;
    x = r * cos(theta);
    y = r * sin(theta);
    output;
  end;
run;

filename animgif "spiral.gif";
filename htmlout "spiral.html";   /* HTML output */

proc stream outfile=htmlout; BEGIN
&amp;lt;HTML&amp;gt;&amp;lt;HEAD&amp;gt;&amp;lt;TITLE&amp;gt;Animated spiral&amp;lt;/TITLE&amp;gt;&amp;lt;/HEAD&amp;gt;&amp;lt;BODY&amp;gt;
&amp;lt;IMG src='spiral.gif'&amp;gt;
&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;
;;;;

ods _all_ close;

ods graphics / width=600 height=600;
*ods graphics / imagename="spiral" reset=index(1) outputfmt=gif;

options 
  printerpath=gif 
  animation=start 
  animduration=0.10 
  animloop=yes 
  noanimoverlay
;

ods printer file=animgif;
options animation=start;

proc sql;
  create table spiral as
  select each.angle as frame, self.x, self.y, self.theta
  from have as self join have as each
  on each.theta &amp;gt;= self.theta
  order by frame, self.theta
  ;

proc sgplot data=spiral;
  by frame;
  series x=x y=y;
  scatter x=x y=y / markerattrs=(symbol=circle);
  xaxis min=-20 max=20;
  yaxis min=-20 max=20;
run;

proc sort data=spiral;
  by descending frame theta;
run;

proc sgplot data=spiral;
  by descending frame;
  series x=x y=y;
  scatter x=x y=y / markerattrs=(symbol=circle);
  xaxis min=-20 max=20;
  yaxis min=-20 max=20;
run;

options animation=stop;
ods printer close;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="spiral.gif" style="width: 800px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/46361i22F9771CCCACEE2F/image-size/large?v=v2&amp;amp;px=999" role="button" title="spiral.gif" alt="spiral.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 17:33:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Any-options-to-create-a-compressed-or-smaller-animated-GIF/m-p/663234#M20095</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-06-18T17:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Any options to create a compressed or smaller animated GIF ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Any-options-to-create-a-compressed-or-smaller-animated-GIF/m-p/663238#M20096</link>
      <description>You haven't specified a resolution/DPI. If you do, does that change the file size?</description>
      <pubDate>Thu, 18 Jun 2020 17:35:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Any-options-to-create-a-compressed-or-smaller-animated-GIF/m-p/663238#M20096</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-18T17:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Any options to create a compressed or smaller animated GIF ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Any-options-to-create-a-compressed-or-smaller-animated-GIF/m-p/663438#M20099</link>
      <description>Yeah. as Reeza said, Try option dpi=200  .</description>
      <pubDate>Fri, 19 Jun 2020 11:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Any-options-to-create-a-compressed-or-smaller-animated-GIF/m-p/663438#M20099</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-06-19T11:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Any options to create a compressed or smaller animated GIF ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Any-options-to-create-a-compressed-or-smaller-animated-GIF/m-p/664003#M20111</link>
      <description>&lt;P&gt;Turns out GIF device is not so easy.&amp;nbsp; The GIF dpi is 96.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=graphref&amp;amp;docsetTarget=n19kyqdfrtxqwcn10x79xxtv18xh.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;Setting the Resolution of Your Graph&lt;/A&gt; doc says:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;About Setting the Resolution&lt;/STRONG&gt;&lt;BR /&gt;Note: Devices other than those listed (PNG, PNGT, PNG300, SVG, SVGT, SVGVIEW, or SVGZ) do not honor the IMAGE_DPI= option.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Using the XPIXELS=, XMAX=, YPIXELS=, and YMAX= Graphics Options to Set the Resolution for the Traditional Devices&lt;/STRONG&gt; &lt;BR /&gt;The resolution of GIF and BMP images is fixed and cannot be changed using this method.&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The only improvement I could get was to ensure the papersize matched the ods graphics size.&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;ods graphics&amp;nbsp; /  width=4in  height=4in ;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt; options 
  papersize =       ("4in",&amp;nbsp; &amp;nbsp; &amp;nbsp;"4in")&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printerpath=gif&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; animation=start&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; animduration=0.10&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; animloop=yes&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; noanimoverlay
;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 15:08:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Any-options-to-create-a-compressed-or-smaller-animated-GIF/m-p/664003#M20111</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-06-22T15:08:32Z</dc:date>
    </item>
  </channel>
</rss>

