Ivan Gusev
Ivan Gusev

Reputation: 361

ghostscript: convert PDF into CMYK preserving pure Black for text

I need to convert RGB PDF into CMYK PDF.

I need to have pure black color for texts.

It seems (thanks to comments below) term "black point compensation" is wrong. I took it from Adobe Acrobat where it works exactly how i need. I thought gs has same feature.

I use ghostscript 9.16

If i got it right there is -dBlackPtComp option, but it does not work for me. Ghostscript command I have tried is:

"c:/Program Files/gs/gs9.16/bin/GSWIN64C.EXE" -o testing_black_cmyk.pdf -sColorConversionStrategy=CMYK -sDEVICE=pdfwrite -dOverrideICC=true -sOutputICCProfile=c:/Windows/System32/spool/drivers/color/JapanColor2002Newspaper.icc -dTextBlackPt=1 -dBlackPtComp=1 test2.pdf

Upvotes: 6

Views: 4479

Answers (2)

user2846289
user2846289

Reputation: 2215

Try this:

collink -v -G AppleRGB.icc JapanColor2002Newspaper.icc apple_to_jNP_photo.icc

collink -v -f AppleRGB.icc JapanColor2002Newspaper.icc apple_to_jNP_neutrals.icc

control.txt:

Image_RGB   apple_to_jNP_photo.icc       0   1   0
Graphic_RGB apple_to_jNP_neutrals.icc    0   1   0
Text_RGB    apple_to_jNP_neutrals.icc    0   1   0

and

gswin32c -q -sDEVICE=pdfwrite -o out.pdf -sColorConversionStrategy=CMYK -sSourceObjectICC=control.txt in.pdf

Then the DeviceRGB in source PDF is converted to DeviceCMYK, and RGB 0/0/0 becomes (as I'm checking now) the DeviceGray 0, which should be OK (and all other neutral RGB shades are mapped to true grayscale, too).

The reason we are using different DL-profiles for different objects, is because, though saturated colors (far from neutrals) will be converted to the same CMYK through both profiles, nevertheless you probably don't want color suddenly switch to 0/0/0/n in continuous tone photographs, if color happens to be near neutral -- it'll look terrible on the press.

If your "images" are e.g. rasterized graphics (diagrams, etc.) with 0/0/0 RGB, then you can consider using apple_to_jNP_neutrals.icc for these images too.

If your page has a mix of both real images and rasterized graphics (text) - bad luck, you'll have to compromise.

The reason we use -G instead of fast and simple Simple Mode, is because -f (for second profile) implies the "Gamut Mapping Mode using inverse outprofile A2B", and we want 2 profiles to produce the result (for saturated colors) as close to each other as possible.

Upvotes: 4

David van Driessche
David van Driessche

Reputation: 7046

From the description on black point compensation on the Little CMS page:

"Black point compensation (BPC) is a technique used to address color conversion problems caused by differences between the darkest levels of black achievable on different media/devices."

In other words, BPC has nothing to do with your problem and if you want proper answers, you should remove it from this question.

If you want black to be preserved (or pure / secondary colors in general), you basically have two options you can look at:

1) Create a proper DeviceLink profile to do your conversion. This devicelink profile should take your input ICC Profile and the destination you want to convert to and should contain proper exception rules to keep black / gray / secondary / tertiary colors as required.

2) Use a color conversion engine that supports exceptions while doing regular ICC Profile conversion. Little CMS for example has an intents flag ("INTENT_PRESERVE_K_ONLY_RELATIVE_COLORIMETRIC") that can be set to instruct the engine to preserve black during conversion.

Upvotes: 0

Related Questions