Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to produce a CMYK PDF file to pass onto a printshop.

When I use the [cmyk] option for the xcolor package, the colours in the resulting PDF do look muted and less vibrant as is the case with the CMYK colorspace. For example,

\documentclass{minimal}
\usepackage[cmyk]{xcolor}
\begin{document}
\textcolor{blue}{\fontsize{24}{28}\selectfont A}
\end{document}

when processed by pdflatex produces a PDF file that appears onscreen like a muted, darkish CMYK colorspace document, but when I run ImageMagick's identify command on the PDF using

identify -verbose cmyk.pdf | grep Colorspace

I get

Colorspace: RGB

Surely the PDF uses only one of CMYK or RGB for colour. How can I reliably tell which?

Also, if it is indeed an RGB PDF why does it appear so different from the version I get if the line

\usepackage[cmyk]{xcolor}

is replaced by

\usepackage[rgb]{xcolor}

Thanks in advance.

share|improve this question
6  
tex.stackexchange.com/questions/9961/pdf-colour-model-and-latex has a lot to say about color and PDF. –  Christian Lindig Mar 9 '11 at 18:45
    
The option [cmyk] causes xcolor to automatically transfrom RGB colors to cmyk (unless it already knows the result), doesn't it? If so: the conversion RGB -> cmyk in xcolor is acceptable, but it could be better. Ah: it is mentioned in @ChristianLindig's link: "which are not very sophisticated -- compare them to the formulas in 10.3 of the PDF spec, with BG(k) and UCR(k) functions, etc" –  Christian Feuersänger Jun 30 '13 at 10:42
add comment

3 Answers

up vote 16 down vote accepted

With using \pdfcompresslevel=0 I'll get the pdf with no compressed streams and can see what happens inside the pdf.

With the cmyk option I get:

stream
0 0 0 1 k 0 0 0 1 K
0 g 0 G
0 0 0 1 k 0 0 0 1 K
1 1 0 0 k 1 1 0 0 K
BT
/F15 24.7871 Tf 91.925 752.955 Td [(A)]TJ
0 0 0 1 k 0 0 0 1 K
0 0 0 1 k 0 0 0 1 K
0 0 0 1 k 0 0 0 1 K
ET
endstream

and with the rgb option:

stream
0 0 0 rg 0 0 0 RG
0 g 0 G
0 0 0 rg 0 0 0 RG
0 0 1 rg 0 0 1 RG
BT
/F15 24.7871 Tf 91.925 752.955 Td [(A)]TJ
0 0 0 rg 0 0 0 RG
0 0 0 rg 0 0 0 RG
0 0 0 rg 0 0 0 RG
ET
endstream

which is what I would expect, a correct color setting. But printing a RGB color is not the same as printing a CMYK color ...

share|improve this answer
    
How did you get that? –  Yiannis Lazarides Mar 9 '11 at 21:40
    
\pdfcompresslevel=0 –  Herbert Jan 18 '13 at 7:19
add comment

There's not really such a thing as a 'CMYK PDF' or an 'RGB PDF'. PDFs can contain objects coloured in RGB and CMYK (and many other) colour spaces. See my answer here for some details. So your statement "Surely the PDF uses only one of CMYK or RGB for colour." is wrong, and it's unclear to me on what basis "identify -verbose" is deciding that it is RGB. Maybe the colorspace just defaults to RGB, even for formats where that doesn't make sense?

As for your question: "How can I reliably tell which?", in addition to @Herbert's suggestion to look at the uncompressed PDF stream (if that means anything to you) you can use Adobe Acrobat Professional has various tools to see which colour spaces are being used and where. An "Output preview" tool; a "Preflight" tool; a "convert colors" tool; etc.

share|improve this answer
    
Thank you for setting me right. Is there a Linux-friendly software package to do what Adobe Acrobat Professional does above? Thanks. –  chandra Mar 14 '11 at 14:47
    
+1---I just ran identify on a PDF created with ConTeXt using only CMYK colors and got Colorspace: RGB as well. Makes me suspect ImageMagick isn't telling the whole story. –  Sharpie May 9 '11 at 4:56
add comment

I add the same problem with a LaTeX file.

I wanted to obtain a cmyk PDF file by using \includepackage[cmyk]{xcolor} but my document was in RGB.

So, since I insert a picture in CMYK color format, the PDF file is in CMYK.

I think if you use coloration for your text, you must add the cmyk option.

For example \definecolor{red}{rgb}{This is text RGB}

For example \definecolor{red}{cmyk}{This is text CMYK}

CMYK does not run if you don't use it.

If all you document is in RGB, your PDF file will be in RGB.

If you insert one mention of cmyk in your code, like in the example, your PDF file will be in CMYK.

Good luck.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.