|→||2.1 Graphics tools|
Convert PNG/JPEG/TIFF to PDF/EPS
|Options to show help text, version, and license|
|Binary data and text data|
|Run-length encoding with multiple data sources in PS level 2|
|Alpha channel and transparency|
bmpp -l driver[.mode] options [-o key=value] file(s)
Bmpp (formerly named bmeps) converts PNG, JPEG, and TIFF images to PS, EPS, and PDF.
Bmpp is a command line program, wxbmpp a GUI application.
The output driver controls which file type (PS, EPS, or PDF) is produced.
The output mode chooses predefined settings for the intended use of the output image: image for standalone viewing, document for printing or viewing an image fitted to a paper size, or object to be placed in a drawing or on a page.
The following output file formats can be produced:
The programs can produce the following file types:
|level=integer||PS level for PS output, 2 or 3.
|color[=boolean]||enable/disable color output when writing
PS/EPS. Ignored for PDF output or for using DCT-encoded data from
JPEG files directly.
|dsc[=boolean]||enable/disable DSC comments when writing
Default: on for ps.document, off for all other driver/mode combinations.
|draft[=boolean]||enable/disable draft mode (create small
placeholder images only).
|predictor=name||Specify a predictor for flate
compression, name is one from "tiff" (TIFF predictor), "sub" (PNG
sub predictor), "up" (PNG up predictor), "average" (PNG average
predictor), or "paeth" (PNG paeth predictor).
|dct[=boolean]||enables/disables direct reuse of
DCT-encoded data from JPEG files.
|bpc[=boolean]||enables/disables reduction of bits per component. Ignored when reusing DCT-encoded data from JPEG files directly. Default on.|
|duplex[=boolean]||prepare print job for duplex printing,
produces a book.
|tumble[=boolean]||prepare print job for tumble (used in
conjunction with duplex only), produces a calendar.
|bg=integer:integer:integer[:boolean]||specify background color as RGB value and
optionally the override flag. The RGB values are in the range
0...255. If the override flag is set the specified background is
always used overriding a background chunk from input file. If the
flag is not set, the background color from a background chunk in
input file is used if available.
|interpolation[=boolean]||enable/disable image interpolation.
|jpeg-interpolation[=boolean]||enable/disable image interpolation when
reusing DCT-encoded data from JPEG files.
|specify either resolution or paper
Resolution is one from:
Default: 1px1pt for objects, chunk for images, a4 paper for documents.
|make[=boolean]||enables/disables make mode when running
on a directory.
The program sets exit status code 0 on success, any other value indicates an error.
In conversions to PS/EPS the data size for one color component of an image line is restricted to 16383 in run-length compression with separated colors.
See the bmpp FAQ: How do I ...? page for examples how to produce different output files.
PS output is always clean 7-bit data (text). Binary data is
converted to text using ASCII85 encoding.
PDF output contains binary data. In contrast to previous versions of bmeps no binary-to-text conversion is applied. So we have binary flate- or DCT-compressed data for image XObjects and flate-compressed data for page contents streams. The size of PDF output files created by bmpp is typically 20% smaller than the size of PDF output files from bmeps.
For PS level 2 ouput the preferred output compression is
run-length compression with multiple data sources.
In worst case we have an overhead of 1/127 if there are no runs found.
If the image is too wide (data for one component of a line would exceed 16384 bytes) the image is written completely uncompressed.
Both PS and PDF files are allowed to contain DCT-encoded data.
When processing JPEG images as input we can re-use the DCT-encoded
data from the JPEG file directly without having to decode and
This allows fast processing and produces small file sizes.
PS output files will be approximately 25% + 1kB larger than the JPEG file (binary data from the JPEG file is converted to text using ASCII85 encoding). PDF output files will be approximately 1kB larger than the JPEG file as the PDF file format requires some structuring data around the DCT-encoded data.
When using DCT-encoded data directly no changes (i.e. from analysis as described in the section below) are applied.
After reading an image the image is analysed (except for DCT-data transferred to output directly):
For some images the use of predictors in conjunction with flate
compression may result in smaller file sizes.
For bmpp you can specify a predictor, this predictor is used for all image lines (in contrast to PNG files where you can specify different predictors for each line).
For all real-life images I used to test use of predictors increased the file size, typically that's not what you want.
I had decreasing file sizes only for images which were especially designed to demonstrate prediction.
So my short recommendation on predictors is: When in doubt, don't use them.
Long version: For the images you want to convert you can run test conversions with and without predictors and compare the results before deciding about a predictor.
PNG and TIFF images can have an alpha channel to express opacity
PS files can not have transparency, only PS level 3 can use image masks for pixels completely transparent or opaque. In previous versions of bmeps it was possible to convert alpha channels into a PS image mask. This feature is discontinued, I never heard of somebody using it.
Images in PDF can have a soft mask, this means we can have partial transparency. When converting an image to a PDF object (-l pdf.object or -l pdf) the alpha channel from the input image is converted into such a soft mask. So you can place the object on top of other objects which will become partially visible through your object.
I prefer to use pdflatex over latex/dvips when dealing with partially transparent images.
In previous versions (2.x.x) the program was named bmeps.