sam2p Flattr sam2p

[the sam2p logo]

sam2p is a UNIX command line utility written in ANSI C++ that converts many raster (bitmap) image formats into Adobe PostScript or PDF files and several other formats. The images are not vectorized. sam2p gives full control to the user to specify standards-compliance, compression, and bit depths. In some cases sam2p can compress an image 100 times smaller than the PostScript output of many other common image converters. sam2p provides ZIP, RLE and LZW (de)compression filters even on Level1 devices.

Parts of this page may be obsolete. See sam2p on GitHub instead.

A testimonail from Grant Ingram, UK: Anyway this is just a quick note to say thanks for writing the sam2p utility which I am using to create EPS figures of photographs for my thesis -- it works very well producing image sizes that are some 3% of the ones produced by ImageMagick.

The author of sam2p recommends his program over other image image converts because of the following reasons:

The author of sam2p recommends his program over ImageMagick:

Long-term limitations:

For more information about sam2p, see the README README (for version 0.42). Please download the latest sources, and read the most recent version of the README there. If you are new to sam2p, please read this before reading anything else.

You may contact the author of sam2p by e-mail:


Linux and Windows binaries and the C++ sources are available from here. Please note that the binaries may be out-of-date. If you need the latest version, compile the sources for yourself. You need a GNU-compatible system (tested on Linux, Mac OS/X, Solaris, Windows MinGW), Perl and GCC G++ to compile sam2p. (If you are a deep wizard, you may try re-compiling under Win32 using cygwin or mingw.) You can easily build a Debian package from these sources.

sam2p uses the cjpeg and djpeg utilities from libjpeg (Debian package libjpeg-progs). sam2p uses the tif22pnm and png22pnm utilities to read TIFF and PNG files; both utilities are written by the author of sam2p -- they are available as source form here and here. Win32 binaries for the dependencies are available here.

sam2p updates are announced on Freshmeat.

An earlier version of sam2p is uploaded to CTAN.

Abstract for EuroBachoTeX 2002

Final version of my article, PDF
Presentation slides for EuroBachoTeX 2002, PDF
EuroBachoTeX 2002 home page

Inserting figures into TeX documents
by Szabó Péter <>

My article deals with the practical considerations of inserting sampled figures into TeX documents. Sub-topics:

sam2p in the world

Richard Solcher has packaged sam2p for Win32 and added a .bat file which automates converting from PNG and JPEG files. Get his software PNG to EPS and JPG to EPS Converter from here.

Mikkel Meinike-Nielsen uses sam2p for adding sampled images to hand-written PostScript documents. See his Text with images tutorial here.

sam2p at Soft5000. Linux software at Soft5000

Valid HTML 4.0!