UoC crest


Bmp2eps converts from BMP/GIF/PNG/JPEG/PNM/TGA to PS/EPS/PDF. So what? you might ask, so do many other programs.

The main claim to fame of bmp2eps is that JPEG images are never decompressed then recompressed, they are simply transferred straight to PostScript or PDF, both of which support JPEG's compression algorithm, without further, potentially lossy, decompression and recompression. It is also the case that bmp2eps tries to make its output as small as possible. In many cases it can produce EPS files which are smaller than the GIFs on which they are based. In 2012 I produced a comparison of how programs treat JPEGs.

The program is distributed as source, and needs remarkably few libraries, just zlib. Its internal PNG reader is, as of version 1.25, sufficiently good that there is little point linking against libpng. It will even build without zlib, but its compression becomes much poorer at that point, and the number of PNG files it can read decreases significantly. Windows compilations are easier without libpng.

It can also produce PNG output. This is often smaller than its input, but there are other PNG crushers, such as pngcrush. For some images bmp2eps does do quite well compared to dedicated crushers, for others it gets beaten. Finding the absolutely minimal PNG representation of an image is a very hard task.

The program for performing the opposite conversion, that of finding JPEG images in PostScript files, and extracting them to JPEGs without any decompression and recompression stages, is psimages, which relies on ghostscript. For the same applied to PDF files, it is pdfimages from xpdf.

As of version 1.30 and 1.30a, bmp2eps has good support for writing HP's RTL in the format that its old DesignJet 1050 series of printers understands. This means that it can transfer a rasterised image to one of these large-format (36 inch wide) printers. For something rather more modern, it can output JPEG or PNG files Base64 encoded for inline inclusion in web pages.

Some may be upset by the name. I changed from jpeg2eps to bmp2eps in 2003, when support for gif, pnm and bmp was first added. The code was not widely known or distributed back then (it was known to around a hundred people). I had written jpeg2eps in March 2001. Yes, it took nine years for me to bother to release this under the GPL! There are now other utilities of overlapping functionality, which have been developed entirely independently of this code.

Some of this code is re-used in the excellent plotting package PyXPlot.

Recent changes

Major changes between 1.20a and 1.30 include:


This code has nothing to do with the University which happens to give its author a stipend. It is provided with no form of warrenty or statement of fitness for purpose, but merely under version two of the Gnu Public Licence.