# \includegraphics PDF, color problem

I'm using pdflatex, and use \includegraphics to include content of figures from PDF. PDF are exported from InkScape.

\begin{figure} [!h]
\centering
\includegraphics[height=3cm]{fig/SUSAN.pdf}
\end{figure}


Included PDF or source SVG has same colors. Green has always RGB value (0, 255, 0). Problem occurs when I include this files from LaTeX. In output PDF on some pages colorspace is darker. Even same image on other page has different colourity.

My PDF http://www.stud.fit.vutbr.cz/~xzamaz00/smutny_smajlik.pdf . As you can see on page 7 (11 in PDF) USAN areas are bright green, but then on page 5 (9 in PDF) are green points on corners more darker.

-
Could be a RGB versus CMYK color model issue. Try it again after loading the xcolor package with the cmyk option. If you get an option clash replace it with \PassOptionsToPackage{cmyk}{xcolor}. Are you using any form of transparency in your document? – Martin Scharrer Apr 18 '11 at 11:37
The question PDF colour model and LaTeX might give some general insight about color model in LaTeX. The last section of the answer mentions InkScape and CMYK and links to the online article "Inkscape Does Support CMYK" which seems to be relevant here. – Martin Scharrer Apr 18 '11 at 11:39
Use a different viewer than Adobe Reader (PDF-X-change viewer does not have this problem) or add \pdfpageattr {/Group << /S /Transparency /I true /CS /DeviceRGB>>} to the preamble of your document. This will make Adobe Reader use the RGB rendering model for pages with transparency. – Martin Heller Apr 18 '11 at 14:50
You need to use \special{pdf: [...stuff...]}. See The dvipdfm manual dvipdfm.pdf for the precise syntax of [...stuff...]. – Martin Heller Sep 26 '11 at 9:59
@Martin: I'll try that, but I've managed to fix the problem by converting the image pdf to PDF 1.3 format. I started a separate question about this (because my problem is with xetex, and not pdflatex): tex.stackexchange.com/questions/29523/… – Matthias Sep 26 '11 at 11:26

Hey I had the same problem with my Lyx docment using pdflatex. I simply copied the line from Martin Heller, \pdfpageattr {/Group << /S /Transparency /I true /CS /DeviceRGB>>} and now my images containing transparency are correctly displayed in the final PDF:)

-

As Martin Heller already points out, this is probably a transparency issue: Your PDF may use page groups, which need special treatment in pdftex/luatex to work. This should be fixed in pdfTeX since 1.40.6, but might fail in luatex - and I don't know about XeTeX. Martin's solution should work with pdftex/luatex.

-
I've read before that this type of problem has been fixed in pdftex, but I'm curious about how it was fixed. Are you able to point me to the changeset/patch that introduced the fix? – Lev Bishop May 27 '11 at 12:38
You'd have to check the changes between 1.40.5 and 1.40.6. The solution is adding the /Group as explained by Martin Heller above if needed (that is if an included PDF has a /Group key or a png has transparency). The synthesized /Group kicks the transparency mechanism of Adobe Reader. – Martin Schröder May 27 '11 at 20:16
The bug was later re-introduced and re-fixed, see this bug report – matth Nov 4 '11 at 13:37

For XeLaTeX, this problem also occurs and can be fixed by running a small program XeLaTeX-FixRGB on the resulting PDF.

-