[OS X TeX] converting jpg to eps

Piet van Oostrum piet at cs.uu.nl
Tue Mar 7 06:29:27 EST 2006

>>>>> Maarten Sneep <maarten.sneep at xs4all.nl> (MS) wrote:

>MS> On 6 Mar 2006, at 17:17, Piet van Oostrum wrote:
>>>>>>>> Stephen Moye <stephenmoye at cox.net> (SM) wrote:
>SM> I didn't know about jpeg2ps so will look it up. I do, however,  use
>SM> Imagemagick (from GW's i-Installer) to accomplish this with:
>SM> % convert foo.jpg foo.eps
>SM> This has worked flawlessly for me.
>>> Yes, but generally this generates (much) larger EPS files.

>MS> Unless you specify that the generated file should be eps2:

>MS> % convert foo.jpg eps2:foo.eps

I always thought that jpeg2ps would only wrap some Postscript code around
the JPEG data (this is what the description says). However it appeared that
the EPS-file resulting from jpeg2ps foto.jpg was considerably bigger than
the original, wheres to my surprise the result of the above convert command
is smaller than that (hardly bigger than the original).

Original JPEG: 198171 bytes
output of jpeg2ps: 252406 bytes
output of convert eps2: 202236 bytes

It appears that jpeg2ps encodes the JPEG binary data with ASCII85 encoding
to get an ASCII file, unless you give it the -b option. Depending on the
compile-time options it could even use Hex encoding instead of ASCII95
which will double the file size.

Output of jpeg2ps -b: 199018 bytes

In this case convert also wrapped the JPEG data. I think this could depend
on the version of ImageMagick.
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet at vanoostrum.org
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/

More information about the MacOSX-TeX mailing list