[XeTeX] CMYK to RGB conversion in xetex.def
Jonathan Kew
jonathan_kew at sil.org
Thu Oct 6 16:30:20 CEST 2005
On 6 Oct 2005, at 3:08 pm, Bruno Voisin wrote:
> Did anybody check the correctness of the CMYK to RGB color
> conversion code in XeTeX's definition file for the graphics
> package, namely( xetex.def?
>
> With the hyperref package, used with the colorlinks=true option,
> the default color (linkcolor) for internal links is red, while the
> default color (urlcolor) for external links is magenta.
>
> Now, if you compare the documentation files /usr/local/teTeX/share/
> texmf.tetex/doc/latex/hyperref/manual.pdf for hyperref and XeTeX-
> notes.pdf for XeTeX, you'll notice the colors for internal links,
> for example in the table of contents, are the same, while the
> colors for external links are different.
>
> Given that xetex.def works internally with RGB colors, and includes
> code for CMYK to RGB conversion, I'm wondering whether this code
> could contain an error, with the result that magenta in XeTeX isn't
> quite the same as magenta in pdfTeX.
It's very possible that there is a difference; however, this does not
(necessarily) mean there's an error. There are multiple different
"standards" for converting rgb colors to cmyk; I recall seeing a note
somewhere that Adobe and Ghostscript use different formulae.
It might well be desirable to adjust xetex.def to match pdfTeX's
output more closely, if possible. But before assuming there's an
error, more research is probably in order. (Have you compared the
results of other paths, such as TeX->dvips->Distiller, TeX->dvips-
>ghostscript, TeX->dvipdfmx?)
Note that you can also specify cmyk colors in XeTeX \special
{color ...} commands, but in this case, they'll be converted to rgb
by the xdv2pdf driver, and the results may not be the same as pdfTeX
gives. (xdv2pdf currently uses Ghostcript's formula, by the way.) Or
does pdfTeX put cmyk values directly into the pdf file? If so, the
result may depend on the viewer you use.
Jonathan
More information about the XeTeX
mailing list