[OS X TeX] converting jpg to eps

Victor Ivrii vivrii at gmail.com
Tue Mar 7 14:20:41 CET 2006


On 3/7/06, Bruno Voisin <bvoisin at mac.com> wrote:
> Le 7 mars 06 à 12:29, Piet van Oostrum a écrit :
>
> > 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.
>
> Back about 4 years ago when I created a TeX version of my
> departmental letterhead, I had to prepare an EPS version of a JPEG
> logo. I used Graphic Converter. However a few days later I did
> receive an email from the numerical simulation group (all using Linux
> boxes and mainframes), telling the EPS file wasn't working properly,
> and sending a properly working alternative EPS conversion.
>
> It turned out the EPS file created with the default settings of
> Graphic Converter included the JPEG code in a form that required
> processing by PostScript operators, and this is what caused havoc on
> the Linux boxes. In particular, the file contained the code,
> immediately after the PostScript comments (the lines starting with %%):
>
> %ImageData: 344 164 8 3 0 1032 2 } exec
> /languagelevel where {pop languagelevel 2 lt} {true} ifelse {
> (JPEG picture requires Postscript level 2
> ) dup print flush
> /Helvetica findfont 20 scalefont setfont 100 100 moveto show showpage
> stop
> } if
> save
> /RawData currentfile /ASCIIHexDecode filter def
> /Data RawData << >> /DCTDecode filter def
> 165.00 78.00 scale
> /DeviceRGB setcolorspace
> { << /ImageType 1
>       /Width 344
>       /Height 164
>       /ImageMatrix [ 344 0 0 -164 0 164 ]
>       /DataSource Data
>       /BitsPerComponent 8
>       /Decode [0 1 0 1 0 1]
>  >> image
> Data closefile
> RawData flushfile
> showpage
> restore
> } exec
>
> The alternative version, by contrast, did not contain similar code,
> which seemed to be triggered by the "JPEG Compression" option in
> Graphic Converter.
>
> Could this be related?

Few days ago I was submitting to the arXiv a couple of articles which contained
a lot of graphics. Originally it was in eps (Maple export) but since I
normally used
pdflatex I converted them to pdf and cropped by Acrobat an extra white space.
However arXiv does not accept graphics in pdf and I converted it back
to eps using convert (ImageMagick); well it did not go well since
Acrobat crop was not honored; so I tried gs with the same result, but
pdftops worked well.

But then arxiv began to complain that eps and submission in general
were too large and using GC I reduced the resolution; also in options
I selected to use jpg compression. This morning I checked their
output; it was fine. I don't know what machines arXiv is using, not
Macs for sure. So at least some jpg are not comfusing ``other'' UNIX
boxes.



>
> Bruno Voisin------------------------- 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/
>
>


--
========================
Victor Ivrii, Department of Mathematics, University of Toronto
------------------------- 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 macostex-archives mailing list