[OS X TeX] converting jpg to eps

Bruno Voisin bvoisin at mac.com
Tue Mar 7 07:06:41 EST 2006


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?

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/




More information about the MacOSX-TeX mailing list