Skip to content

r under linux: creating high quality bmp's for win users

10 messages · Christoph Lehmann, Jan T. Kim, Shelby +5 more

#
Hi

I produce graphics with R under linux, but my collaborators often use 
windows and cannot import eps pics e.g. in msword

what is the standard way to get e.g. bmp's with the same quality as eps. 
  going the way: creating eps, convert eps2bmp using 'convert' doesn't 
yield good enough bmp's

thanks for a short hint

cheers
christoph
#
On Tue, 22 Mar 2005, Christoph Lehmann wrote:

            
Are they sure?  One can import eps images into Word, but you need to print 
them on a postscript printer.
The bitmap() device might do better, although both are really using gs.

I would use png() and convert to bmp with ImageMagick's convert or 
otherwise.
#
On Tue, Mar 22, 2005 at 11:59:25AM +0100, Christoph Lehmann wrote:

            
The too short version: You can't get bmps of the same quality as encapsulated
postscript because bmp is a raster format and postscript is a language that
implements vector graphics.

The somewhat more useful (hopefully) version: You can always use gs to
produce a fixed resolution raster snapshot of your EPS file, e.g.

    gs -r600x600 -sDEVICE=bmp16m -sOutputFile=x.bmp -dNOPAUSE x.eps -c quit

This allows you to control the resolution (-r option) and should allow
you to produce any "quality" that may practically suffice, although this
is a kludge.

Best regards, Jan

P.S.: I believe that the convert program just acts as a wrapper to gs
anyway, with a resolution that is chosen to be useful for screen graphics
rather than for printing.

P.P.S.: I'll never understand why Word & Co. don't support encapsulated
postscript. With all that OLE and whatever, it can't be impossible to
do as LaTeX / xdvi does...?
#
Hello Christoph!

In the past, I used an utility called "eps2wmf".
It only works under Windows though (maybe under Linux with wine?).
I believe it is available on the CTAN (Tex archives).

The nice thing is that wmf files are not bitmap and scale well.

Christophe Pallier
Christoph Lehmann wrote:

            
#
I have also recently come across a conversion program that works with
ghostscript to convert ps and pdf images into other vector formats,
including .wmf and .emf for M$ software: http://www.pstoedit.net/.  This
might be helpful if your colleagues do not have, as Dr. Ripley
indicated, a postscript printer (if they do have a PS printer then the
regular .eps files produced by ghostscript should work fine, but they
will not be rendered at proper resolution on the screen preview while
they are working on the document).

Note: I have not given this program a thorough workout in comparison to
imagemagick or anything else - just enough to see that it does what it
says it does.

===============================
Shelby L. Berkowitz
Ecological-Community Psychology
and Institute for Health Care Studies
Michigan State University
berkowi4 at msu.edu
#
Christoph Lehmann wrote:

            
It is impossible to get BMPs with same quality as EPS, as the latter is 
mainly a vector format, so it scales perfectly.  It also uses hardware 
(PostScript) scalable fonts.

The simplest way to meet this need might be to ask your collaborators to 
either update or explore their copies of MS Word.  The version I am using 
(MS Word 2002 SP3) not only imports and prints EPS files correctly, it adds 
previews so they can be seen while editing. Although EPS support has varied 
among Word versions, it seems to be getting better in recent years.

Slightly off-topic:  The Windows metafile formats are native Windows vector 
graphics, sometimes recommended as substitutes for EPS.  In my experience, 
they suffer two problems: (1) They are not portable across platforms; and 
(2) the way they choose fonts is machine-specific, which can cause some 
very annoying problems.
#
Can you provide a link.  I did a google search and found something
on a Japanese site but it turned out that the writer had made a 
mistake and it linked to wmf2eps, not eps2wmf.

Christophe Pallier <pallier <at> lscp.ehess.fr> writes:

: 
: Hello Christoph!
: 
: In the past, I used an utility called "eps2wmf".
: It only works under Windows though (maybe under Linux with wine?).
: I believe it is available on the CTAN (Tex archives).
: 
: The nice thing is that wmf files are not bitmap and scale well.
: 
: Christophe Pallier
:
: Christoph Lehmann wrote:
: 
: > Hi
: >
: > I produce graphics with R under linux, but my collaborators often use 
: > windows and cannot import eps pics e.g. in msword
: >
: > what is the standard way to get e.g. bmp's with the same quality as 
: > eps.  going the way: creating eps, convert eps2bmp using 'convert' 
: > doesn't yield good enough bmp's
: >
: > thanks for a short hint
: >
: > cheers
: > christoph
: >
: > ______________________________________________
: > R-help <at> stat.math.ethz.ch mailing list
: > https://stat.ethz.ch/mailman/listinfo/r-help
: > PLEASE do read the posting guide! 
: > http://www.R-project.org/posting-guide.html
: 
: ______________________________________________
: R-help <at> stat.math.ethz.ch mailing list
: https://stat.ethz.ch/mailman/listinfo/r-help
: PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
: 
:
#
I second the use of png() to create portable network graphics format
pictures, as MS Word (XP and 2003 at least) can handle these without any
problems. I use this format as a matter of course in preparing material for
embedding in web pages.

Regards,

Mike
#
On Tue, 22 Mar 2005, Shelby wrote:

            
AFAIK, it converts to those formats only under Windows.  If you are going 
to allow running quite complex applications under Windows, consider 
running R under Windows!

  
    
#
Oops, sorry: I spread a false information in my previous post.

I used, years ago, wmf2eps to convert metafiles -> eps, and not the 
other way round.

Apologies to people who have searched for eps2wmf !

The only utility that I have sometimes used to convert from eps to a 
vector format (xfig) is pstoedit.

Christophe Pallier

Gabor Grothendieck a ?crit :