If we compile this with pdftex and open in evince 3.18.2-1 (and other viewers), the color is violet, instead of blue:

\pdfliteral{1 1 0 0 k}
\vrule height 5cm width 5cm

Please somebody share your experience how you use colors in pdftex and which viewer you use to display them on screen correctly (on linux).

I read a lot of forums, but i can't understand why CMYK colors are displayed incorrectly on screen. I found this bug report: https://bugs.freedesktop.org/show_bug.cgi?id=14526 Is it relevant here? Is it a bug in poppler library?

Some explanation of this mess would be much appreciated.

NOTE If we use Grey color space, the colors are displayed correctly. But let's suppose that we want to use CMYK. How do we do it properly in plain tex?


There is very enlightening information:

The problem is with different color spaces based on different physical principles of visualization. In printed-oriented color space (CMYK), e.g., "0 0 0 1 k" means: use zero cyan, zero magenta, zero yellow but full black ink.

The Gay color space is derived from RGB (but more simple) and it is based on the light intensity. "0 g" means: use zero light on your monitor. "1 g" means: use full light, but what does it mean? What is white? The light intensity when one is looking to a white paper and perceives the reflected light? But how strong is the light source during this experiment? Is here the dusk or we are at direct sunlight? How much the paper reflects the light? Is it good paper or recycled paper? All these light conditions cannot be included to the calculation when we say "0 0 0 0 k" which means "white like used paper". What light intensity chooses the visualizer which uses the monitor in this situation? It is absolutely impossible to know this. So the "printing" color space is unconvertable to "light" color space. But we need to do some estimations, when we need to do the conversion of color spaces.

These estimations are incorporated to the ICC profiles. May be the ICC profile used by evince supposes that the full black ink will reflect a slight part of the light back to the user eye. But this is only an estimation because the ICC profile is unable to know the quality of used ink (and the quality of used paper too). Maybe it represents the fact that printing technology (using CMYK) is unable to print absolutely black color because the black ink cannot be absolutely black(?).

Such estimations are bad from physical principle, so best solution is simply use "no light" for "0 0 0 1 k". But the developers of evince have different opinion. Evince developers decided, that the black color in CMYK colorspace must be repesented differently than black color in Grey and RGB space.

So, the question becomes this: how to change ICC profile for evince?


If in CMYK you need to make at least black color look really black on monitor (because greyish text is somewhat harder to read), use the following patch for poppler pdf rendering library:

--- poppler-0.44.0.orig/poppler/GfxState.cc
+++ poppler-0.44.0/poppler/GfxState.cc
@@ -1453,6 +1453,11 @@
   rgb->r = clip01(dblToCol(r));
   rgb->g = clip01(dblToCol(g));
   rgb->b = clip01(dblToCol(b));
+  if ((color->c[0] == 0) && (color->c[1] == 0) && (color->c[2] == 0) && (color->c[3] == 65536)) {
+    rgb->r = 0;
+    rgb->g = 0;
+    rgb->b = 0;
+  }

 static inline void GfxDeviceCMYKColorSpacegetRGBLineHelper(Guchar *&in, double &r, double &g, double &b)

I posted the bug report here.

closed as off-topic by egreg, Andrew Swann, Romain Picot, Paul Gaborit, Jesse Jan 21 '16 at 8:59

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.