groff
[Top][All Lists]
Advanced

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

Re: [Groff] ps: import of an EPS file with binary data


From: Tadziu Hoffmann
Subject: Re: [Groff] ps: import of an EPS file with binary data
Date: Fri, 6 Jul 2012 00:30:44 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

> I'm using convert (from imagemagick) to crop and convert pbm
> images into encapsulated postscript. When I prefix the output
> filename with eps2: I get a very compact EPS file where the image
> data is contained as binary like this:
[snip]


Okay, I just completed a few tests and my conclusion is that
the fact that it's binary is not by itself the best criterion
regarding compactness.  Depending on the type of your images,
flate compression + ASCII base-85 can be almost as good as
or even much better:

  convert lena.ppm lena.eps2
  gs -q -dNODISPLAY -dBATCH -dNOPAUSE ppmtops.ps <lena.ppm >lena.ps

    49167  lena.ppm
    53624  lena.eps2
    59425  lena.ps

"lena" is a rather "noisy" image and compression doesn't seem
to be very effective.  What you're seeing here is probably
mostly the 7-bit/8-bit difference in the encoding.

On the other hand, "teapot" is a very smooth image, and
compression really shines here:

  convert teapot.ppm teapot.eps2
  gs -q -dNODISPLAY -dBATCH -dNOPAUSE ppmtops.ps <teapot.ppm >teapot.ps

    196623  teapot.ppm
    201258  teapot.eps2
     53708  teapot.ps

And if you have JPEG files, it's best to keep them that way
and simply wrap them with a simple DCT decoder in Postscript,
as Thomas Merz's jpeg2ps does.


Attachment: ppmtops.ps
Description: PostScript document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]