Question

I am converting an RGB PDF to CMYK using the following command:

/usr/local/bin/gs -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite \ 
-sColorConversionStrategy=CMYK -sColorConversionStrategyForImages=CMYK \
-dProcessColorModel=/DeviceCMYK -dEncodeColorImages=false \
-dEncodeGrayImages=false -dEncodeMonoImages=false -sOutputFile=CMYK.PDF RGB.PDF

The resulting file is 100% CMYK, however anything that was 100% black in the RGB PDF is now:

C: 72%
M: 68%
Y: 67%
K: 89%

The result is that black is a slightly dark grey when really it should be black.

Is there anything I need to add to this command to ensure black remains as black during the conversion?

Was it helpful?

Solution

With the current version of pdfwrite you are restricted to the colour conversions in the software, and there is nothign you can do about this.

The colour management is undergoing serious revision, and the next release should make it possible to deal with this.

OTHER TIPS

Examples of Ghostscript commands to convert PDF from sRGB or eciRGB_v2 to eciCMYK_v2 (FOGRA 59) while keeping black plain (K only), not rich (CMYK)

I managed to convert PDF file in RGB to CMYK while keeping RGB black #000000 plain K black, not rich CMYK black.

DeviceLink ICC had to be created from e.g. eciRGB_v2 (or sRGB, if your source is sRGB) profile to the appropriate CMYK profile using collink tool (from argyll package) with the "-f" attribute to hack the black colors.

Ghostscript is then called with a control file declaring use of the profile and its parameters.

Example of making the DeviceLink RGB to CMYK profile

collink -v -f eciRGB_v2.icc eciCMYK_v2.icc eciRGB_v2_to_eciCMYK_v2.icc

Example of a control file to map eciRGB_v2 to eciCMYK_v2

Image_RGB   eciRGB_v2_to_eciCMYK_v2.icc 0   1   0
Graphic_RGB eciRGB_v2_to_eciCMYK_v2.icc 0   1   0
Text_RGB    eciRGB_v2_to_eciCMYK_v2.icc 0   1   0

Sample ghostscript command to do the actual conversion

gs -o 2-output-cmyk-from-eciRGB.pdf \
       -sDEVICE=pdfwrite \
       -sColorConversionStrategy=CMYK \
       -sSourceObjectICC=control-eciRGB_v2.txt \
       1-input-rgb.pdf
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top