[texhax] help

Lars Madsen daleif at math.au.dk
Wed Nov 21 13:00:35 CET 2018

Reinhard, thanks for mentioning this, I never even realised that PNG was an issue link that.

Do you have more information about this? Especially which is better to use for quality (and speed)

I did a test on a preprint, where if we use PNG versions of some tif files it ends up at 50Mb, converting the tifs to pdf using sam2p reduced this to 30.

/Lars Madsen
Institut for Matematik / Department of Mathematics
Aarhus Universitet / Aarhus University
Mere info: http://au.dk/daleif@math / More information: http://au.dk/en/daleif@math

From: texhax <texhax-bounces+daleif=imf.au.dk at tug.org> on behalf of Reinhard Kotucha <reinhard.kotucha at web.de>
Sent: 20 November 2018 00:21
To: Peter Flynn
Cc: TeXhax
Subject: Re: [texhax] help

On 2018-11-19 at 11:41:23 +0000, Peter Flynn wrote:

 > On 19/11/2018 11:09, Philip Taylor wrote:

 > > Why not PDF ?  Since Prasad is using XeLaTeX, and since XeTeX
 > > provides \XeTeXpdffile, conversion to PDF would seem a definite
 > > option to me.
 > I am under the impression (perhaps mistaken) that TIFF is a bitmap
 > format, so PNG would seem to be more appropriate than PDF.

Dear Phil and Peter,
though it sounds curious, you are both right.

It makes a lot of sense to convert bitmap graphics to PDF.  TeX Live
provides a program (Windows only) called sam2p, written by Péter
Szabó, which converts bitmaps to EPS or PDF.

This program is very fast, creates very small files, supports many
bitmap formats, and is easy to use:

  sam2p foo.tif foo.pdf

For details see:  https://pts.50.hu/sam2p/

As far as TeX is concerned, converting bitmap graphics to PDF in
advance is advantageous.

The PDF standard doesn't support either TIFF nor PNG.  pdftex, luatex,
and xetex are using the libpng library in order to de-compress PNG
files and convert them to PDF's native bitmap format.  All this is
done at runtime e.g., each time you compile your TeX document.

If you convert PNG files to PDF in advance, TeX includes them without
further processing.  This is much faster and can save you a lot of
time, especially if there are many such files.

It's a pity that almost nobody is aware of sam2p.

BTW, TeX Live provides sam2p only for Windows.  This is on purpose.
Linux distributors prefer to provide it as a separate package because
it's also useful to people who are not using TeX.


Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de

TeX FAQ: http://www.tex.ac.uk/faq
Mailing list archives: http://tug.org/pipermail/texhax/
More links: http://tug.org/begin.html

Automated subscription management: http://tug.org/mailman/listinfo/texhax
Human mailing list managers: postmaster at tug.org

More information about the texhax mailing list