1

I'm still trying to convert an RGB-pdf to an CMYK-pdf using PSOcoated_v3.icc as outputProfile (see my earlier question). I'm convinced now that ghostscript treats the profile like lcms2 does (and apparently also Photoshop). However, when using ghostscript to write a PDF file the black still looks washed out so I decided to dig into the PDF file and grab the cmyk color value.

The situation is as follows: I start with an RGB-pdf exported from Inkscape which is simply a black rectangle filling up the entire page; lets name that file black.pdf. Now I convert the pdf via

gs -dBATCH -dNOPAUSE -dNOCACHE \
  -sDEVICE=pdfwrite \
  -sProcessColorModel=DeviceCMYK \
  -sColorConversionStrategy=CMYK \
  -sOutputICCProfile=PSOcoated_v3.icc \
  -sDefaultRGBProfile=sRGB2014.icc \
  -dOverrideICC=true \
  -dRenderIntent=1 \
  -sOutputFile=black.cmyk.pdf\
  black.pdf

and examine the content of the resulting pdf. The print commands for the rectangle look different whether I use gs9.20 from the debian repository or gs9.22 binary from ghostscript website.

in case of version 9.20 I get

q 0.1 0 0 0.1 0 0 cm
/R7 gs
0.722 0.675 0.671 0.882 k
0 0.0195313 10902.9 7748.55 re
f
Q

and for version 9.22

q 0.1 0 0 0.1 0 0 cm
/R7 gs
1 1 1 0 k
0 0.0195313 10902.9 7748.55 re
f
Q

In both cases the cmyk-black value is different from [0.83, 0.67, 0.51, 0.95] which I would expect using the PSOcoated_v3 profile and relative colorimetric intent.

Simply changing to sDevice=tiff32nc yields the expected cmyk representation for black.

Any ideas?

By the way. Is the output color profile saved within the pdf?

cima
  • 63
  • 1
  • 5
  • 1
    In general the ICC profile is not saved. If you were to set a DeviceIndependentColor instead of CMYK then the ICC profile would be stored in the PDF file, because the color would be expressed in terms of the ICC profile space. If you think there's a bug then I'd encourage you to report a bug, Stack Overflow isn't really the right place for this kind of discussion, since its not about programming. – KenS Oct 19 '17 at 07:23
  • The pdfwrite ignores most color conversion options (gs9.27), and only converts colors like tiff32nc when page is rasterized. AFAIU, the `sOutputICCProfile` is not used for color conversions in normal pdf-pdf conversion. [These](https://stackoverflow.com/a/56941566/1032586) my experiments demonstrate various related cases. – Igor Jul 25 '19 at 11:33

0 Answers0