Forum How do I...?

Get a grayscale PDF

ixgal
hi,
sometimes I work with images in RGB or CMYK, and would like to export the PDF in grayscale.
Is there some way to do this?
Thanks!
mikeday
Not yet, but we are currently investigating color conversion for the next release.
mikeday
We now have a new --convert-colors option in the latest builds which will convert all the colors and images to use the ICC color profile specified by the --pdf-output-intent option, so you can specify a grayscale color profile and get a grayscale PDF.
ixgal
hi Mike, thanks!
arthurattwell
I've not been able to find a grayscale color profile that works. Existing ones I've found have a 'Display' profile class, and I assume Prince need one with a printer class.

Does anyone else have a source for a grayscale color profile, or guidance on how to create one?
wangp
It's fine to use a 'Display' class ICC profile with --convert-colors.

You can try Gray-elle-V2-srgbtrc.icc or others from the same repository.
Description here: https://ninedegreesbelow.com/photography/lcms-make-icc-profiles.html#Gray

An example of an 'Output' class ICC profile is available here: http://www.colormanagement.org/en/isoprofile.html#ISOcoated_v2_grey1c_bas
However, the result will probably be too dark unless you embed the ICC profile in the PDF and use a color managed PDF viewer.
maddesigns
How can I avoid that images are transformed?
dauwhe
I get an actual error with a "Display" class profile when trying to get a grayscale PDF/X-4:

error: invalid ICC profile class 'Display' for PDF/X-4 output intent


My Kingdom* for a 20% Dot Gain Grayscale output ICC profile!



*I don't actually have a Kingdom
mikeday
Do downstream processors require such a profile? Do they happen to have one available? :D
twantzen
Okay, sorry for bringing this up again, but I’m stuck with converting to grayscale.

I found the DotGain15 profile here:
http://bechtle-media.de/assets/download-dierotationsdrucker/DotGain15.zip

And I integrated the following CSS:
prince-pdf-output-intent: url(data:application/vnd.iccprofile;base64,[...profile data goes here...]);
prince-pdf-page-colorspace: gray;
prince-pdf-color-conversion: all;
prince-pdf-profile: "PDF/X-4";


All data is properly converted to grayscale, BUT all texts with color: prince-overprint( cmyk(0,0,0,1) ); are converted to 94% K!

How can I preserve CMYK black while converting all RGB images to grayscale? Can someone please help me with this?

Thanks, Tobias
mikeday
Currently we don't have a way to selectively convert only certain colors, so I think this will require converting the images separately outside of Prince or finding a different ICC profile with the desired CMYK conversion behaviour.
mikeday
The Prince latest builds can now apply color conversion to individual elements! :D
ixgal
Thanks!
twantzen
For anyone looking for a good CMYK to grayscale profile, I found "ConvertToK_ISOcoated.icc" here:
https://printplanet.com/threads/converting-cmyk-iso-coated-to-grayscale-offset.12654/
cayhorstmann
Thanks, I tried --pdf-output-intent=ConvertToK_ISOcoated.icc, and indeed the output looks nice and gray. But what makes a "good" profile? Does it depend on some physical properties (paper, ink)? Is there a canonical grayscale conversion?
twantzen
@cayhorstmann Yes, "good" was a bit sloppy of me. Profiles always depend on physical properties such as paper, press, etc. But you'll rarly find CMYK2Greyscale profiles at all. And this one was the only one, which preserved 100K texts as 100K, and converted over all tonal values of some test images fine for my needs.
So, it was "good" for my needs, but may be it's not for yours. Test it out thoroughly.
mikeday
There are some additional grayscale ICC profiles mentioned in this thread:

https://www.princexml.com/forum/topic/5009/some-pages-only-in-cmyk-black