HOWTO: Embed Colour Managed Images in PDFLaTeX

PDF documents that display correctly on a computer monitor generally do not print with correct colours and vice versa. This issues is caused by the difference in the interpretations of the RGB colour space. Since printers don't use RGB, they convert an RGB image to CMYK with varying result. The International Color Consortium (ICC) provides a solution to this: a standardized colour management system (ISO 15076) where an image implicitly or explicitly specifies the actual colour space used. The RGB ranges, typically 0-255, are then exactly mapped to actual colours.

The ICC system is supported by the PDF format, but it can be hard to find an unbroken chain of software that all acknowledge and support colour profiles. This howto describes a way of embedding images with colour profiles in a PDF generated by LaTeX, more specifically by PDFLaTeX.

  1. ProPhoto Example

    Figure 1: ProPhoto profiled image.

    Make sure you have a colour managed image. You can get this from more advanced digital cameras or scanners. If you want to manage an unmanaged image, I would suggest applying the sRGB profile on an RGB image.

    Example images can be found in figures 1 and 2. These should look identical on a colour managed system. Since the ProPhoto gamuth (spanned colour space) is larger than sRGB, the image will appear less saturated if rendered as sRGB.

  2. sRGB Example

    Figure 2: sRGB profiled image.

    Load your image into a colour managed program. Under Linux I've found only Scribus to accurately handle colour profiles for both import and export. Under Windows Adobe Photoshop can import managed images and export to managed PDFs.

    In Scribus you have to create a document with the size that you want your image to have in your final document. Then import your image into the Scribus document and adjust the size and settings so that it exactly matches the size of the page.

  3. Profile PNG Scr/PDF PSP/PDF
    None (sRGB) X X X
    sRGB X X X
    ProPhoto X X X

    Table 1: Example files.

    Save or export your image as PDF and make sure the colour profile is also saved. In Scribus you have to turn off any bleed or other printing features.
  4. Embed your PDF in your LaTeX document using includegraphics.
  5. table.pdf

    Table 2: Example PDFLaTeX
    generated document.

    Now when you compile your LaTeX document with PDFLaTeX the PDFs will be embedded as they are, which means that they will have colour profile which can be used by the rendering software.
  6. Some final notes: CUPS does not seem to have support for colour management at the moment, but the rendered quality seem to be better than without using colour profiles anyhow. With the files generated from Photoshop the colour management did not work with CUPS.