Repository navigation
Closed
Description
Describe the bug
If the printer reports support for 1-bit bi-level raster (print-color-mode=bi-level, pwg-raster-document-type=black_1), libppd will remap -o print-color-mode=bi-level to =monochrome, because the ippeve generator uses ColorModel=FastGray for 1-bit output, but libppd remaps FastGray to print-color-mode=monochrome instead of =bi-level.
Lines 386 to 395 in 4afdca9
| if ((choice = ppdFindMarkedChoice(ppd, "ColorModel")) != NULL) | |
| { | |
| // | |
| // ColorModel is taken from PPD as its default option. | |
| // | |
| if (!strcmp(choice->choice, "Gray") || | |
| !strcmp(choice->choice, "FastGray") || | |
| !strcmp(choice->choice, "DeviceGray")) | |
| keyword = "monochrome"; |
To Reproduce
PPD file has:
*cupsFilter2: "image/pwg-raster image/pwg-raster 100 -"
*OpenUI *ColorModel: PickOne
*OrderDependency: 10 AnySetup *ColorModel
*en_US.Translation ColorModel/Color Mode: ""
*ColorModel Gray: "<</cupsColorSpace 18/cupsBitsPerColor 8/cupsColorOrder 0/cupsCompression 0>>setpagedevice"
*ColorModel FastGray: "<</cupsColorSpace 3/cupsBitsPerColor 1/cupsColorOrder 0/cupsCompression 0>>setpagedevice"
*en_US.ColorModel Gray/Grayscale: ""
*DefaultColorModel: FastGray
*CloseUI: *ColorModel
I'm printing with: lp -d testp_l -o ColorModel=FastGray -o print-color-mode=bi-level -o page-ranges=1 document-a4.pdf
And the result:
D [22/Oct/2026:16:53:03 +0300] [Job 36] cfFilterGhostscript: Ghostscript command line: gs -dQUIET -dSAFER -dNOPAUSE -dBATCH -dNOINTERPOLATE -dNOMEDIAATTRS -dUsePDFX3Profile -sstdout=%stderr -sOutputFile=%stdout -sDEVICE=cups -sMediaClass=PwgRaster -sOutputType=automatic -r300x300 -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -dcupsBitsPerColor=8 -dcupsColorOrder=0 -dcupsColorSpace=18 -dcupsBorderlessScalingFactor=0.0000 -dcupsInteger1=1 -dcupsInteger2=1 -scupsRenderingIntent=auto -scupsPageSizeName=A4 -dcupsManualCopies -I/usr/share/cups/fonts -sOutputICCProfile=sgray.icc -c -f -_
Second bug, in libcupsfilters: OpenPrinting/libcupsfilters#298
Metadata
Metadata
Assignees
Labels
No labels
Activity
DSingh0304 commentedon Nov 13, 2026
I'd like to fix this one. In
ppdConvertOptions() (ppd-cache.c), FastGray always becomes "monochrome", so bi-level is never requested. I'll map it to bi-level when the printer supports it and add a test.ValdikSS commentedon Nov 13, 2026
Keep in mind that the IPP printer might have
black_1inpwg-raster-document-type-supportedonly, but announceprint-color-mode-supported=monochrome, withoutbi-level. That's also acceptable according to specification as far as I could see.This means that CUPS, somehow, needs to generate 1-bit output even with
print-color-mode=monochrome, if the printer has onlypwg-raster-document-type=black_1.But maybe that could be seen as another bug, and probably not in libppd.
Also see OpenPrinting/libcupsfilters#298
DSingh0304 commentedon Nov 13, 2026
Thanks @ValdikSS , that makes sense. I opened #106 for the
bi-levelcase here. A printer with onlyblack_1that lists monochrome still getsmonochrome; I left that for libcupsfilters #298 . I can look at that one next if nobody else is on it.ppd-cache.c: Map FastGray to bi-level when the printer supports it
darkvision77 commentedon Nov 15, 2026
I'm not sure about closing this one too.
If I have a printer that reports
print-color-mode-supported=bi-level, it still getsmonochrome(PPD from driverless). This happens regardless of whetherlpis run without arguments or with-o ColorModel=FastGray -o print-color-mode=bi-level.If I pass only
-o print-color-mode=bi-leveltolp, something really strange happens:Where
bi-level+monochrome/sgray_1+black_8means that the printer reportsprint-color-mode-supported=bi-level,monochrome(default:bi-level) andpwg-raster-document-type-supported=sgray_1,black_8(default:sgray_1).DSingh0304 commentedon Nov 15, 2026
#106 fixed the mapping in libppd's
ppdConvertOptions(), which is what the issue pointed to. What you see with lp comes from CUPS's owncopy, _cupsConvertOptions()incups/ppd-cache.c(used bybackend/ipp.c), which still maps FastGray to monochrome. So the libppd fix is correct, but the same change is needed in OpenPrinting/cups for normal printing.