Introduction to PDF Color, Part II: Shades of Gray

Introduction to PDF Color, Part II: Shades of Gray

The PDF format has 11 different color spaces and for my introduction to PDF color, I wanted to be able to specify black and white in as many of these color spaces as I could. I overshot by a bit, and started calling this output PDF my 15 shades of Gray. Because I can’t count.

Different ways of specifying a white to black shading pattern.
Different ways of specifying a white to black shading pattern.

All of these strips are basically constructed the same way:

Filling a rectangle with an Axial Shading Pattern with two colors:  black and white, and white and black. For example:


Before I go further, I should point out that I originally started by doing color wheels with each wedge essentially the same, but comparing color wheels meant paging up or down in Acrobat, and the effect was a bit like an Eye Exam (“Tell me what you see, between 1 …and 2. And 1 again…”) So I switched to rectangular strips, but on a portrait-oriented page, and the rest of my presentation PDF was landscape-oriented, so:


Just like DeviceGray, but with a WhitePoint, a BlackPoint, and  gamma values taken from an example given in the PDF Reference:


Just like CalGray, but with three values instead of just one:

With this Whitepoint, this strip looks pinkish on screen. I’ve had this strip print out nicely gray…on one type of printer, and pinkish on another printer.


Just like CalRGB, but without the whitepoint, blackpoint, etc. values:


Here we’re back to specifying whitepoint, etc. but to specify Black and White, we are only going to change the value of the L component:


This colorspace offers a good number of ways of specifying Black.

White will always be:

But with CMYK, we can specify black just using the K channel:

or all channels (aka register black, not recommended):

or CMY black:

or Photoshop’s default Rich Black:

or an alternate rich black:

You can also specify a warm black or a cool black

but while these are black at the edge of the Axial shading pattern,  the effect isn’t quite the shades of gray we’ve been seeing for the other blacks.


The following is effectively the same as the black channel-only CMYK example but instead of specify null values for the CMY components, you are specifying a grays as tint values for the K component.


The last three are using three single-component (Grayscale) ICC profiles that fell off the back of a truck and into my temp directory.

By changing the value of black and white based on the number of components to appropriate values for RGB and CMYK-based ICC profiles, I could have easily reached fifty shades of gray…but I’m not that much of a masochist.

Leave a Reply

Your email address will not be published.