PDF Association logo.

Facebook
Twitter
YOUTUBE
LINKEDIN
XING
Datalogics
Status: Partner Member
Country: US
Sector: All industries
Contact:
Joined at: Feb 08
Website: http://www.datalogics.com/

Linked User
Maryanne Pavlin
Matt Kuznicki
Nicki Bullock
Vel Genov
Emma Kaschke
Leonard Ho

Intro to PDF color with Datalogics: Fun and Games with ICC Profiles

One of the slides of my Introduction to PDF color presentation was this page of Ducky pictures. Are all of these images of Ducky the same or different?

SwapICCProfiles-out1

It’s a trick question, of course: The binary data of each image, pixel for pixel, is exactly alike. And yet if you compare individual Duckies, you can see that this one has warmer yellows, while this one’s are a bit washed out in comparison, and a couple have shadows that are almost orange and so on. What I had done was secretly replace the coffee with…no. I replaced the ICC Profile for each image of Ducky with a different profile.

Now, I’m not going to share that ugly code with you, instead I’m going to share the Somewhat Improved™ version, which now picks up more ICC profiles and doesn’t require that an image already be using an ICC profile.

There are several steps involved.

First, find an image element and extract some pertinent information such as its physical width and height (rather than its pixel width and height) and the number of color components that the image uses.

ICC pic 1

Next, we find all the compatible icc profile in our stash of icc  profiles. And by compatible, I mean that the number of color components match up to what we’re looking for.

ICC pic 2

Then we create a page large enough to hold all of the image tiles we’re going to create.

ICC pic 3

Then  for each profile, we are going to copy the image from the source document to a particular position on the new page, also creating an annotation which will tell us which ICC profile will be used for that image in that position.

ICC pic 4

Lastly, we are going to iterate through all of the page’s XObjects, remove the existing ColorSpace entry and replace it with a CosObject clone of an ICCBasedColorspace we instantiated with a stream containing an ICCProfile from a file.

ICC pic 5

The code equivalent of meatball surgery (“Yes, I grew up watching re-runs of M*A*S*H, why do you ask ?”).  This isn’t at all the proper work-flow for specifying ICC profiles for an image, which ideally should have an ICC Profile specific to the device that took the image already embedded in the image.

But swapping different ICC profile can sometimes subtly change how the image is rendered at the edges of the color gamut and letting some colors pop while de-emphasizing others.

Learn more about Adobe PDF Library offered by Datalogics and start your free eval today.

Related Products
Adobe PDF Library


The Adobe PDF Library SDK is a low-level PDF library that contains a powerful set of native C/C++ APIs with interfaces for .NET and Java APIs. Systems integrators, independent software vendors (ISVs), enterprise IT developers, and others can integrate Adobe PDF functionality within custom applications in a client and / or server environment.

PDF Java Toolkit


Datalogics PDF Java Toolkit is a native Java library that provides high-level APIs for automating PDF workflows like processing PDF forms, verifying digital signatures, and extracting text. It also offers low-level APIs for working directly with the structure of the PDF for those times you need it.

Adobe PDF Converter


Adobe Normalizer, is an API which allows developers to quickly and easily convert Encapsulated PostScript (EPS) and PostScript (PS) files to Adobe’s Portable Document Format (PDF). The industry-standard Adobe Distiller and Distiller Server are themselves built upon PDF Converter SDK; and now this API is available separately to application developers.

Adobe PDF Print Engine


The Adobe PDF Print Engine is a common rendering engine technology, packaged as a software development kit (SDK). It can be the basis for a variety of products for previewing and printing Adobe Portable Document Format (PDF) documents at different stages of the professional print workflow.

PDF2IMG


Datalogics PDF2IMG is a command-line utility that converts PDF files to a variety of image formats including PNG, JPG, TIFF, BMP, and more. It is built upon the Adobe PDF Library and uses Adobe technology for unrivaled color management during the PDF conversion process

PDF Alchemist


Datalogics PDF Alchemist is a new (C/C++) SDK for intelligently extracting text and images from PDFs and exporting to HTML 5 or EPUB. It employs sophisticated techniques to identify and reconstruct “text flows” within the PDF.