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

Till Kamppeter till.kamppeter at gmail.com
Wed May 19 13:46:54 UTC 2021


On 19/05/2021 14:55, Jonas Smedegaard wrote:
> 
>> What I want to have is the following:
>>
>> I want that if a user prints an arbitrary (PDF) file that he gets the
>> best color gammut which the printer supports. This should work fully
>> automatically, as most users do not know about color management.
> 
> Have CUPS consult DBus interface of colord and if that provides a
> printer ICC profile (or an ICC profile is hardcoded in the PPD file),
> then pass -sOutputICCProfile="..." to ghostscript.
>

This I already do, I only need to verify whether the correct 
-sOutputICCProfile="..." argument gets added to the GS command line and 
I also have to let the output color space be Device... and not sRGB or 
AdobeRGB then (printer must support Device... for that).

Only if there is no icm profile available and/or printer does not 
support Device... I have to somehow make the decision between sRGB and 
AdobeRGB. Here I would need to somehow examine the input file.

> You could optionally have CUPS inspect if the PDF file has defined an
> output intent and if certain that it provides one, then (as I understand
> it) additionally pass -dUsePDFX3Profile to ghostscript.
> 

Here I would like to know how to examine the input PDF file. 
Ghostscript? Any other tools? QPDF?

I especially need to examine the input PDF to make the decision on 
whether to use sRGB or AdobeRGB in the case the printer supports both.

> 
>> Now what is the best strategy now to make best use of the color spaces
>> the printer support, to once not cut down the color gammut of the
>> input file when sRGB gets used on a printer which could do AdobeRGB
>> and also not loose color depth if a n input file with a color gammut
>> fitting into sRGB is printed in AdobeRGB.
> 
> There is no single answer - it depends on which "best" you want.
> 
> That's why you need to consult the system and the print job.

The "best" I want is the one with which I can expect the best output 
quality for a given input file on a given printer (which can be 
sRGB-only or in addition support one or both of AdobeRGB and 
Device...+printer's ICC profile.

    Till


More information about the gs-devel mailing list