[gs-devel] PDF rasterization for driverless printing: Color Management

Ken Sharp ken.sharp at artifex.com
Wed May 19 06:54:54 UTC 2021


Hi Till,

Sorry this has taken so long to get replied to, our colour expert (Michael 
Vrhel) isn't on gs-devel and didn't realise there was a question requiring 
his input.

Because he isn't subscribed to gs-devel he can't answer directly, so I'm 
posting this to the list on his behalf.

8<-----------------------------------8<--------------------------------8<
Hi Till,

See my answers below:

 >- If an incoming PDF file is sRGB, it should be rasterized to an sRGB
 >   Raster file and sent to the printer
 >
 >- If an incoming PDF is AdobeRGB and the printer supports AdobeRGB, it
 >   should be rasterized in AdobeRGB

The idea that the incoming PDF file is sRGB or is AdobeRGB makes no sense.
A PDF page can define many objects each in different color spaces.  Some
objects could be in sRGB some could be in AdobeRGB.  There is the concept of
a PDF file having an output intent.  In this case, that is the color space
to which the rendering should be targeted.  If the input file has an
OutputIntent and you wish to render to that target, then you would add in
the following command line option:

-dUsePDFX3Profile

If you wish to render to a particular output color space (e.g. sRGB or
AdobeRGB or some target ICC profile for the device) then you will want to
specify the following:

-sOutputICCProfile="ICC_profile.icm"

Where you can specify for example

"srgb.icc"  for sRGB
"a98.icc"   for AdobeRGB (1998)

as these ship with with Ghostscript, or you can specify the profile file
name that want to use.

If you use both -sOutputICCProfile="ICC_profile.icm" and -dUsePDFX3Profile
and there is an output intent included in the PDF file, the output intent is
an intermediate mapping (i.e. proofing profile) that will be used.

Unless you really want that, it would be my recommendation that you just use

-sOutputICCProfile="ICC_profile.icm" and not -dUsePDFX3Profile

 >
 >Now my questions are
 >
 >- Does this command line convert the input to the destination color
 >   space (the cupsColorSpace value)? So that if I set cupsColorSpace=20
 >   that I always get AdobeRGB output? Or do I need any additional command
 >   line arguments?

You have to specify what I said above to map to the different color spaces.

 >- If I opt for DeviceRGB (cupsColorSpace=1) or DeviceGray
 >   (cupsColorSpace=3) how do I supply the ICC profile (which I have in a
 >   file) to the Ghostscript call so that the output is in this color
 >   space? Which command line options do I need to add?

-sOutputICCProfile="ICC_profile.icm"  where ICC_profile.icm is the file you
said you have.

 >- If I print a photo from a user application and the application sends
 >   it as PDF but in AdobeRGB would the above command line (with
 >   cupsColorSpace=20) conserve the AdobeRGB and not do any inbetween
 >   conversion to sRGB or anything else?

Again, this idea of a PDF being in AdobeRGB makes no sense to me.  But if
there is content in the PDF that is defined in that color space and you
specified

-sOutputICCProfile=" a98.icc "

There should not be any loss in color fidelity in this case.

Regards,

Michael
8<-----------------------------------8<--------------------------------8<


                     Ken



More information about the gs-devel mailing list