MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Exports to eps, pdf ImageSize

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99933] Re: [mg99858] Re: Exports to eps, pdf ImageSize
  • From: bzgragge at hsr.ch
  • Date: Tue, 19 May 2009 06:48:37 -0400 (EDT)
  • References: <gujgd0$or6$1@smc.vnet.net>,<200905160921.FAA26891@smc.vnet.net>

Hi

I tried your answer. The actual dpi of the sreen is said to be 96 dpi by the control panel of my windows system xp, and I think it is this resolution that is assumed by the eps/pdf application viewer (?). These dpi numbers yield a ratio 96/72 = 4/3, but physically the ratio of sizes was significantly more than 4/3.

I tried this:

gr = Plot[Cos[x], {x, -2, 2}];
Export["D:\\test1.pdf", gr, ImageSize -> {3/4*360, 3/4*224}];
Export["D:\\test1.eps", gr, ImageSize -> {3/4*360, 3/4*224}];
Export["D:\\test1.jpg", gr, ImageSize -> {360, 224}];
Export["D:\\test1.gif", gr, ImageSize -> {360, 224}];

Measuring with a ruler gives a width of 10cm = 3.94'' for .pdf and 7.8cm = 3.07'' for .gif and .jpg, despite of the above 3/4 reductions in ImageSize option of Export. To my opinion all pictures should be equal in physical width.
Moreover, similar tests with different sizes have shown that the ratio of phyiscal widths is dependent of the ImageSize.

So I think there must be another, more subtle reason or there must be something I do not understand ?

Regards
Bernhard Zgraggen, HSR

________________________________________
Von: ragfield [ragfield at gmail.com]
Gesendet: Samstag, 16. Mai 2009 11:21
An: mathgroup at smc.vnet.net
Betreff: [mg99858] Re: Exports to eps, pdf ImageSize

On May 15, 5:33 am, bzgra... at hsr.ch wrote:
> Exports of a graphics expression to .pdf (and also .eps) create bigger images when the files are sent to a printer or a viewer than raster graphics as .png, .gif etc. or scalable vector graphics .svg. Setting the ImageSize does not solve the problem, unfortunately.
>
> gr = Plot[Cos[x], {x, -2, 2}];
> Export["C:\\test1.pdf", gr, ImageSize -> {360, 224}];
> Export["C:\\test1.eps", gr, ImageSize -> {360, 224}];
> Export["C:\\test1.jpg", gr, ImageSize -> {360, 224}];
> Export["C:\\test1.gif", gr, ImageSize -> {360, 224}];
>
> I also tried many options like ImageMargins, ImagePadding, PlotRangePadding, PlotRange, PlotRangeClipping etc. without success.
>
> Why is it that .pdf and .eps create bigger images

Just to clarify, when you say "bigger images" are you referring to the
file size or the image dimensions?

Regarding file size, as you stated, PDF & EPS are vector formats.  In
this particular example they simply contain more data than the raster
formats, resulting in larger file size.

Regarding image dimensions, this is probably a quirk of the viewer
software.  If you examine the PDF or EPS file you see that the
dimensions are correctly specified as 360x224.  If you import the PDF
back into Mathematica you'll see it correctly displayed at 360x224.
If you display it in Preview (or presumably Adobe Reader) it appears
physically larger.  These viewer applications try to be clever by
taking your actual screen resolution into account.  The PDF & EPS
coordinate systems are 72 DPI.  For this example they compute the
desired size to be 5"x3.11".  Then they try to display it as close to
5"x3.11" as possible, rather than at the natural 360x244.

> and how can I compute as exactly as possible the ratios of these relative enlargements? The problem arises in Version 5, 6 and 7 and on different machines (Windows XP, Switzerland).

You would have to know what the viewer application thinks your
physical screen resolution is.  If it is 100 DPI the graphic would
appear 500x311 pixels.  If it is 133 DPI the graphic would appear
665x414 pixels.  {w,h}*actualDPI/72.

-Rob


  • Prev by Date: Re: Followup question: Problem with parallel evaluation of integrals
  • Next by Date: Re: Re: Future for Mathematica on Solaris
  • Previous by thread: Re: Exports to eps, pdf ImageSize
  • Next by thread: PlotLegend