[cups] Color issues when printing via lp

Helge Blischke helgeblischke at web.de
Wed Feb 26 07:45:38 PST 2020



> Am 25.02.2020 um 00:24 schrieb Henry Betts <henry at itstheflashpack.com>:
> 
> Hi,
> 
> I'm having some issues printing from the command line, and I wondered if
> anyone had any thoughts, or could point me in the right direction.
> 
> My system is ubuntu 18.04 and the printer driver is provided by gutenprint.
> If I print an image (I am currently testing with a png) from ubuntu /
> gnome's image viewer, the print comes out fine. However, if I print the
> same file from the command line (i.e. *lp print.png*) then the print comes
> out with the colors not looking quite right.
> 
> I can't see any mention of a color profile / icc in the printer's ppd file,
> however I can see, looking at colord, that a profile has been generated and
> set as the printer's default. My guess is that this is not being applied
> when printing via lp.
> 
> Looking at the cups logfile, I see that the image viewer submits the job as
> type application/pdf (it must convert the png to pdf beforehand) and uses
> the filters:
> *pdftopdf*
> *gstoraster*
> *rastertogutenprint*
> 
> Printing from lp uses the filters:
> *imagetoraster*
> *rastertogutenprint*
> 
> I had a quick look through the source code for gstoraster and
> imagetoraster, and it looks like imagetoraster doesn't perform a colord
> lookup, whereas gstoraster does - is this correct?
> I then tried converting the png to pdf myself (*convert print.png print.pdf*)
> and then printed the pdf (*lp print.pdf*). This now uses the gstoraster
> filter, and I can also see in the logs that it is finding the correct
> profile from colord. However, it still prints with the same color issues as
> before, so I am not sure what the problem could be.
> 
> I would appreciate any suggestions.
> 
> Many thanks,
> 
> Henry
> 

A quick look into the sources of the pdftopdf filter (a fairly recent version) does not seem to 
perform a collard lookup, but generates a new PDF from the input PDF and in doing so 
retains the ICC settings of the source PDF.
I think the image viewer does the colord lookup (presumably differently for display and printing)
but convert doesn’t (or at least differently).

So I’d suggest you print from the image viewer and afterwards print the image viewer generated PDF
from the command line:
sudo -i 
cd /var/spool/cups
lp dxxxxx-001
where xxxxx is the cups job-ID (the mentioned file should be the last one listed by the ls command).

Both printouts then should look the same.

If so, you’d have to tweak the cups filter chain for image printing via lp

Helge


More information about the cups mailing list