Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Graph output: wmf to gif?


From   cnguyen@stata.com
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Graph output: wmf to gif?
Date   Tue, 01 Apr 2003 14:36:01 -0600

Lee Sieswerda earlier wrote an excellent summary of exporting Stata graphs
and the different type of graphics formats.  I'll just add some comments
where appropriate.

> StataCorp has pointed out that Stata's implementation of PNG is experimental
> at the moment. I have tried to use Stata's PNG format, but the results
> appear rudimentary (maybe I'm missing something). The W3C considers PNG a

Our implementation of PNG is experimental in the sense that we're still
working on the compression and need to add PNG to -graph export-.  Expect
something in the next update.

> The only graphic format within Stata that I have found acceptable for
> publication quality graphics is EPS/PS. Actually, its more than acceptable,

EPS is definitely the best format for publishing graphs.  Whenever I have
to print documents that contain EPS files to a non-PostScript printer, I
convert my documents to PDF and use Acrobat Reader to print them out.

> it is near perfect. To my eyes, the WMF/EMF format often makes wonky
> circles, text isn't spaced properly, and other problems. The image quality
> in Stata's PNG implementation is jaggy, especially the text portions. The

In regards to the output quality of Stata's PNG implementation, that's not a
limitation of Stata or PNG but a limitation of how things are drawn to the
screen.  Stata's PNG implementation is just capturing the bitmap on the screen
so what you see on the screen is what's being saved in the PNG file.  You
would get the same output in GIF, TIFF, JPG, or any other bitmap format.

Mac OS X on the other hand has a new graphics interface (Quartz 2D) which
Stata now supports.  Graphs drawn to the screen look just as good as what you
see in an EPS file.  Exporting to a bitmap format like PNG yields very high
image quality because what's on the screen is of high quality.  Saving a graph
as a PICT file however does not yield the same high quality output because the
PICT format relies on Quickdraw which does not support the high quality
rendering that Quartz 2D does.  The same is true for WMF.

> 2. For publication quality, 
> 	a) I save my graph as both WMF and as EPS. 
> 	b) Using Ghostscript and GSView, I attach the WMF file to the EPS as
> a preview image. This allows me to view and print the graph in my word
> processor. When the file is printed on a PostScript-compatible printer it
> prints the flawless EPS version.

We hope to address this in a future update.  We plan on adding TIFF support
and once we have that, we can embed a preview image in the EPS file.  The
other advantage of including a preview image is that the preview is what's
printed when printing to a non-PostScript printer.

> 3. If I were publishing on the web on a regular basis, I would save my
> graphs in EPS format and then buy/beg/borrow/steal a good image optimizer or
> graphics package to convert to GIF or JPEG. Or, if I could, I'd wait and see

That's what we did for the graphs on the "New graphs in Stata 8" page on our
website (http://www.stata.com/stata8/graphics.html).  We exported the graphs
to EPS format, read them into Adobe Photoshop where it rasterized them into
bitmaps using smooth, antialiased lines, curves, and text, and exported them
into GIFs.  In Stata for Macintosh, we could've avoided the extra steps by
exporting directly to PNG and would have gotten similar, high quality results.

By the way, the next update will add round endcap support to connected lines
when drawing to the screen and saving to an EPS file.  You'll see better
results when drawing thick, connected lines.

> how good Stata's PNG implementation gets. There are a lot of image

Whatever we do to our PNG implementation won't improve what's already on the
screen.

-Chinh Nguyen
 cnguyen@stata.com

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index