psimages

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXAMPLES
WARRANTY
BUGS
AUTHOR
SEE ALSO
TRADEMARKS

NAME

psimages - extract bitmap images from (Encapsulated) PostScript files

SYNOPSIS

psimages [-nodct] psfile [image-root]

DESCRIPTION

psimages reads a PostScript (or EPS) file, and extracts all bitmap images found therein. Images which were DCT-compressed are extracted as JPEG files, other images are output as PNGs. This program uses ghostscript to perform the conversion, and the nature of PostScript is such that it does not work on absolutely all possible PostScript files. It works on all files I have encountered in real life, rather than created artificially. This program was inspired by Glyph & Cog’s excellent pdfimages which does a similar thing for PDF files.

The images output are named image-root-nnn.xxx where nnn is the image number and xxx is the image type (.jpg or .png).

If image-root is omitted, it defaults to "image".

If image-root is given as "-", the first image only is output to stdout.

OPTIONS

-nodct

output DCT-compressed images as PNGs, not JPEGs. This option is provided in case the code path for dealing with DCT images fails. The PNG code path is very different, and probably more robust.

EXAMPLES

To extract all bitmaps in paper.ps to files with names starting "fig"

psimages paper.ps fig

To convert the first bitmap in diag.eps to a PDF

psimages diag.eps | bmp2eps -pdf > diag.pdf

(The above could be very useful if the EPS was simply a single bitmap, and especially so if it was a single DCT-compressed bitmap, for in that case it will not decompress or recompress. The bmp2eps program is available separately, and other lossless jpeg to pdf converters exist.)

WARRANTY

Absolutely none. The author makes no claim that this code is fit for any purpose: use it only if you are satisfied with it.

BUGS

Fails to cope with files containing more than 1,000 bitmaps.

Other issues may be reported to its author, @cam.ac.uk

AUTHOR

mjr19

SEE ALSO

pdfimages(1), bmp2eps(1).

TRADEMARKS

PostScript is a trademark of Adobe Systems Incorporated.