I have a LaTeX document with several black and white, gray value, and color images. When creating a PDF with pdfLaTeX I get a PDF where I am not sure if the embedded black and white images are actually set as black and white (important for the printing costs).
Is there a way to test which images are set as black and white, gray value, and color; and if necessary force pdfLaTeX to set them as black and white?
Best Answer
Ghostscript can convert color documents into grayscale. Example commandline:
The most recent version of Ghostscript can also check for the CMYK ink coverage of PDF documents (not image by image, but page by page), using a new "device" called
inkcov
. Check for the ink coverage of an example PDF:Example output:
Here 1.00000 would mean 100%, 0.02525 means 2.525% and 0.00000 means 0% ink coverage. You can see here that pages 1+4 are using no color, while pages 2+3 do. This case is particularly 'nasty' for people who want to save on color ink: because all the C, M, Y (and K) values are exactly the same for each of the pages 2+3, they possibly could appear to the human eye not as color pages, but as grayscale (or "rich" grayscale in the case of page 3) anyway. (That is, if each single pixel is mixed with these color values -- of course, if the page is made by four different squares of the same size using "pure" colors each, then you'd get the same ink coverage result).
Now convert the original PDF to a grayscale one, using the command I initially gave. Then check for the ink coverage distribution again (note how the addition of
-q
to the parameters slightly changes the output format):