[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Size of produced eps



On Sat, 16 Apr 2005, Ryszard Tanas wrote:

> On Sat, 16 Apr 2005, Gunnar wrote:
>
> > On Thursday 14 April 2005 18.37, Jacques L'helgoualc'h wrote:
> >
> >>> On Thu, 14 Apr 2005, Gunnar wrote:
> >>>> I just wonder how the size of the produced eps-file can be so large.
> >>>> From a 731 byte file to 113 kb. eps.
> >>>
> >>  sed -i -e '/^%%BeginPreview/,/^%%EndPreview/d' Gunnar-example.ps
> >>
> >> reduces the size to 40K ; then there is the font part...
> >
> > So it would perhaps be better just to produce eepic files and include
> > them in my LaTeX document?
> >
That's what I do. :) So far as I know, the advantages of eps files are
that you needn't recompile an entire document to change one figure, you
can preview color in xdvi, and you can use graphicx to perform scaling
(etc.) that might be difficult to achieve in an eepic file (maybe you
want 72-pt type:)

> The bad guy producing large PostScript is not dvips but ps2epsi which
> is used by elaps and adds the Preview to the file. I would like to draw
> your attention to the nice perl script by Roland Bless called ps2eps. This
> script is very useful for manipulating ps-files. With option -P you can
> just remove the Preview and get smaller file. In fact you can replace
> ps2epsi in elaps by ps2eps (with some fiddling) and you will get smaller
> files automatically.
>
In an attempt to facilitate this kind of change, line 113 (or thereabouts)
of elaps specifies the ps2eps converter. However, Ryszard is correct that
changing this line to

PS2EPS="ps2eps --quiet -P"

doesn't quite work, because elaps wants to fix some name information in
the eps file. It's sufficient to change line 388 from

$PS2EPS $ELAPS_TEMP_PS 1> $ELAPS_STDERR

to something like

$PS2EPS $ELAPS_TEMP_PS && mv ${ELAPS_TEMP_PS%%"ps"}eps $ELAPS_TEMP_EPSI


The data below aren't a systematic test, but do suggest there's a general
ordering of file sizes, with about 0.3 -- 1.5 order of magnitude increase
in file size at each step:

  xp < pdf/eepic < ps/eps without preview < eps with preview

Original files:
-rw-r--r--    1 hwang    hwang        1231 Apr 16 09:48 arcs.xp
-rw-r--r--    1 hwang    hwang        1473 Apr 16 09:48 planetest6.xp
-rw-r--r--    1 hwang    hwang        1922 Apr 16 09:48 trefoil.xp

"arcs" contains a couple of circular arcs, "planetest" is a hundred or so
shaded polygons with a lot of hiding due to layering, and "trefoil" has a
couple thousand shaded quadrilaterals without much hiding.


elaps' PDF output:
-rw-r--r--    1 hwang    hwang        3764 Apr 16 10:13 arcs.pdf
-rw-r--r--    1 hwang    hwang        4544 Apr 16 10:13 planetest6.pdf
-rw-r--r--    1 hwang    hwang       49046 Apr 16 10:13 trefoil.pdf

epix output:
-rw-r--r--    1 hwang    hwang        1678 Apr 16 09:57 arcs.eepic
-rw-r--r--    1 hwang    hwang       10208 Apr 16 09:57 planetest6.eepic
-rw-r--r--    1 hwang    hwang      289292 Apr 16 09:57 trefoil.eepic

Modified (no preview) elaps:
-rw-r--r--    1 hwang    hwang       34107 Apr 16 09:57 arcs.eps
-rw-r--r--    1 hwang    hwang       42284 Apr 16 09:57 planetest6.eps
-rw-r--r--    1 hwang    hwang      433132 Apr 16 09:57 trefoil.eps

Unmodified (preview) elaps:
-rw-r--r--    1 hwang    hwang      180098 Apr 16 09:50 arcs.eps
-rw-r--r--    1 hwang    hwang      313856 Apr 16 09:50 planetest6.eps
-rw-r--r--    1 hwang    hwang      662550 Apr 16 09:51 trefoil.eps


--Andy

Andrew D. Hwang			ahwang@mathcs.holycross.edu
Department of Math and CS	http://math.holycross.edu/~ahwang
College of the Holy Cross	(508) 793-2458 (Office: 320 Swords)
Worcester, MA, 01610-2395	(508) 793-3530 (fax)