Understanding the PDF file Format – ICCBased Colorspaces

I introduced Color in a previous article and there are lots of different types of Colorspaces to suit all occasions. One of the more complex and powerful Colorspaces is the ICC Colorspace which deserves more explanation.

ICCBased colorspace allow the user to include a file in the PDF (a profile) defining the Colorspace values according to standards laid down by the International Color Consortium (ICC). There are several versions of the ICC standard and the level of supported has been updated in PDF version revisions. Here is how it appears inside a PDF file. The ICC profile is in the stream data.

70 0 obj[/ICCBased 91 0 R]

91 0 obj<<

/Alternate/DeviceGray

/Length 2905

/N 1

/Filter/FlateDecode>>

stream

The only problem with ICCBased colorspaces is that not all PDF tools may support the ICCBased so you can specify an Alternate colorspace to use (/DeviceGray in the example above). Using the Alternate colorspace will result in an approximation which is often identical to using the ICCBased value (and it can be a lot faster!).

ICCBased colorspaces can have 1, 3 or 4 components (defined by the N dictionary value. So they often use Gray (1 component), RGB (3 components) or CMYK (4 components). So these are common values for Alternate values.

This combination of power, flexibility and alternatives makes ICCBased colorspaces very useful to use in PDF files. Are you making full use of them?

This post is part of our “Understanding the PDF File Format” series. In each article, we aim to take a specific PDF feature and explain it in simple terms. If you wish to learn more about PDF, we have 13 years worth of PDF knowledge and tips, so click here to visit our series index!

Related Posts:

The following two tabs change content below.

Mark Stephens

System Architect and Lead Developer at IDRSolutions
Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX. He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.
Markee174

About Mark Stephens

Mark Stephens has been working with Java and PDF since 1999 and has diversified into HTML5, SVG and JavaFX.

He also enjoys speaking at conferences and has been a Speaker at user groups, Business of Software, Seybold and JavaOne conferences. He has a very dry sense of humor and an MA in Medieval History for which he has not yet found a practical use.

2 thoughts on “Understanding the PDF file Format – ICCBased Colorspaces

  1. bohdan

    Thank you, but too little information.
    What should i do to add ICCBased color space ?
    In Pdf specification there is some ICC profile stream and i don’t understand where it comes from.
    Could you please explain ?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>