.TH psimages 1 .SH NAME psimages - extract bitmap images from (Encapsulated) PostScript files .SH SYNOPSIS .B psimages [-nodct] psfile [image-root] .SH DESCRIPTION .B 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 .B pdfimages which does a similar thing for PDF files. The images output are named .I image-root-nnn.xxx where .I nnn is the image number and .I xxx is the image type (.jpg or .png). If .I image-root is omitted, it defaults to "image". If .I image-root is given as "-", the first image only is output to stdout. .SH OPTIONS .LP .TP .B -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. .SH EXAMPLES .LP To extract all bitmaps in paper.ps to files with names starting "fig" .IP psimages paper.ps fig .LP To convert the first bitmap in diag.eps to a PDF .IP psimages diag.eps | bmp2eps -pdf > diag.pdf .LP (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 .B bmp2eps program is available separately, and other lossless jpeg to pdf converters exist.) .SH 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. .SH BUGS Fails to cope with files containing more than 1,000 bitmaps. .LP Other issues may be reported to its author, @cam.ac.uk .SH AUTHOR mjr19 .SH SEE ALSO pdfimages(1), bmp2eps(1). .SH TRADEMARKS PostScript is a trademark of Adobe Systems Incorporated.