[cups] Problems printing fine lines -- debugging halftone screening, resolution, rasterization?

John Hawkinson jhawk at alum.mit.edu
Fri Jan 5 07:40:16 PST 2024


Hi. Cups 2.3.4 under MacOS 12 (sorry).

I'm having problems printing fine lines on a Brother HL-L2330 laser printer, and I'm having trouble figuring out how to debug the problem properly, and how to figure out whether it is an issue with CUPS's rasterization or something the printer is doing, and I haven't been successful in figuring out the right way to solve this from the CUPS documentation, so I thought I would stop and ask for help before racking up more hours in frustration.

I'm trying to print some very fine lines -- a custom vernier measurement scale -- and I drafted them as 0.1 pt lines in Adobe Illustrator. Printing them from Illustrator they come out fuzzy and halftone screened. Rendering Illustrator's PDF to a 1200ppi PNG, I get sharp lines that are two pixels wide, but when printed they come out fuzzy and discontinuous and halftone-screened. I've printed from Illustrator, from Photoshop, from Preview. I've printed the Illustrator PDF, the RGB PNG, converted the RGB PNG to a 1bpp black-and-white PNG and printed that, from Preview, from Photoshop, all with varying results that are all bad (some worse than others).

I think what I want to do is learn to inspect the output from CUPS before it is transmitted to the printer, and determine whether this is a printer problem or a rasterization problem, and I don't understand how to do that properly.

Can someone help me to do this?


I began by confirming my printer's capabilities with ipptool, which was somewhat of a frustrating exercise.
I set IPPURI to the ipp URL to my local printer, and none of these commands produce any output:

jhawk at lrr ~ % ipptool "$IPPURI" get-printer-attributes.test       
jhawk at lrr ~ % ipptool -v "$IPPURI" get-printer-attributes.test 
jhawk at lrr ~ % ipptool -v -l "$IPPURI" get-printer-attributes.test 
jhawk at lrr ~ % ipptool -v -c "$IPPURI" get-printer-attributes.test 

>From the man page and usage (ipptool -\?), I expected some output from the first, some verbose output from the second, "text" from the third, and "csv" from the 4th.
Conversely, though the XML and verbose "test report" functions seem to work, but super-verbosely:

jhawk at lrr ~ % ipptool -X "$IPPURI" get-printer-attributes.test 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ipptoolVersion</key>
<string>CUPS v2.3.4</string>
...
jhawk at lrr ~ % ipptool -tv  "$IPPURI" get-printer-attributes.test       
"/usr/share/cups/ipptool/get-printer-attributes.test":
...

Is this a bug (or more than one?)? Am I using ipptool incorrectly? It was striking to me that the man page didn't give examples that were helpful to me.


Anyhow, the printer purports to support (from -tv):

        printer-resolution-supported (1setOf resolution) = 600dpi,300dpi,1200dpi
        output-mode-supported (1setOf keyword) = monochrome,auto,auto-monochrome
        document-format-supported (1setOf mimeMediaType) = application/octet-stream,image/urf,image/pwg-raster
        printer-make-and-model (textWithoutLanguage) = Brother HL-L2350DW series
        printer-device-id (textWithoutLanguage) = MFG:Brother;CMD:PJL,HBP,URF;MDL:HL-L2350DW series;CLS:PRINTER;CID:Brother Laser Type1;URF:W8,CP1,IS4-1,MT1-3-4-5-8,OB10,PQ3-4-5,RS300-600-1200,V1.4,DM1;
        urf-supported (1setOf keyword) = W8,CP1,IS4-1,MT1-3-4-5-8,OB10,PQ3-4-5,RS300-600-1200,V1.4,DM1
        document-format-preferred (mimeMediaType) = image/urf
        pwg-raster-document-resolution-supported (resolution) = 600dpi
        pwg-raster-document-sheet-back (keyword) = rotated
        pwg-raster-document-type-supported (keyword) = sgray_8

I take this to mean that the printer supports 1200dpi input, but only in image/urf format, not in image/pwg-raster (because pwg-raster-document-resolution-supported is 600dpi only).

There's some concern in my mind as to whether 1bpp bitmap printing without halftone screening is possible, given that pwg-raster-document-type-supported is only sgray_8, which means I asssume 8bpp at 600dpi before halftone screening. I'm not sure how to parse the urf-supported key I don't know if that means I am doomed.

Anyhow, with that in mind, I currently have two printers defined in CUPS that both connect to this physical printer, one with the

Driver:	HL-L2350DW series - IPP Everywhere (grayscale, 2-sided printing)
Driver:	Brother HL-L2350DW series CUPS (grayscale, 2-sided printing)

The IPP everywhere drivers's PPD has:

*cupsFilter2: "image/urf image/urf 100 -"
*OpenUI *cupsPrintQuality: PickOne
*OrderDependency: 10 AnySetup *cupsPrintQuality
*en_US.Translation cupsPrintQuality/Print Quality: ""
*DefaultcupsPrintQuality: Normal
*cupsPrintQuality Draft: "<</HWResolution[300 150]>>setpagedevice"
*en_US.cupsPrintQuality Draft/Draft: ""
*cupsPrintQuality Normal: "<</HWResolution[300 300]>>setpagedevice"
*en_US.cupsPrintQuality Normal/Normal: ""
*cupsPrintQuality High: "<</HWResolution[1200 1200]>>setpagedevice"
*en_US.cupsPrintQuality High/High: ""

And the Print dialog box, under Printer Features, does allow me to select Print Quality: High, which I assume is necessary to get 1200 dpi output.

How do I find out how CUPS would generate the URF for my PDF, and how do I intercept and inspect it?
I guess URF is an Apple proprietary format, is there a viewer I can use MacOS?

I thought at first I could do this with "cupsfilter", although I'm pretty uncertain. Also it is deprecated, and it's hard to tell what the replacement is (what is the replacement?).

I ran:

jhawk at lrr % cupsfilter  -P /etc/cups/ppd/${PRINTERNAME}.ppd -m application/vnd.cups-raster -o cupsPrintQuality=High input.pdf > output.ras

Which seems like it is doing the right thing, but I don't know if this is the same way that the filter chain is being invoked by CUPS:

...
DEBUG: HWResolution = [ 1200 1200 ]

But I was able to view output.ras with Michael Sweet's RasterView, and it looked ok.
Similarly with -m image/urf.
But again, I'm not sure if I'm actually seeing what the printer would be seeing.

Is there logging I can turn on to determine that?


I also tried the Brother driver, which seems to have more knobs, but it's not clear to me how they matter.

*cupsFilter:    "application/vnd.cups-raster 0 /Library/Printers/Brother/Filter/rastertobrother2290.bundle/Contents/MacOS/rastertobrother2290"
*cupsFilter: "application/vnd.cups-command 0 /Library/Printers/Brother/Filter/commandtobrother.bundle/Contents/MacOS/commandtobrother"

*%==== Resolution =================================
*OpenUI *BRResolution/Print Quality: PickOne
*OrderDependency: 11 AnySetup *BRResolution
*DefaultBRResolution: 1200dpiFullSpeed
*BRResolution 300dpi/300 dpi: "<</HWResolution [300 300]/cupsColorOrder 0/cupsColorSpace 3 >> setpagedevice"
*BRResolution 600dpi/600 dpi: "<</HWResolution [600 600]/cupsColorOrder 0/cupsColorSpace 3 >> setpagedevice"
*BRResolution 2400x600dpi/HQ 1200: "<</HWResolution [1200 1200]/cupsColorOrder 0/cupsColorSpace 3 >> setpagedevice"
*BRResolution 1200dpiFullSpeed/1200 dpi: "<</HWResolution [1200 1200]/cupsColorOrder 0/cupsColorSpace 3 >> setpagedevice"
*CloseUI: *BRResolution

*%=== Halftone Pattern ================================
*OpenUI *BRHalfTonePattern/Graphics Quality: PickOne
*OrderDependency: 22 AnySetup * BRHalfTonePattern
*DefaultBRHalfTonePattern: Brother
*BRHalfTonePattern Brother/Graphics: "<</cupsBitsPerColor 8 >> setpagedevice"
*BRHalfTonePattern Brother4/Text: "<</cupsBitsPerColor 8 >> setpagedevice"
*CloseUI: *BRHalfTonePattern



It looks like there's the potential to change the halftone pattern, but /cupsBitsPerColor is always set to 8 regardless, and the color space is the same as well.

So...can anyone give me some pointers on how to figure out whether it is possible to bypass the halftone screen on this printer and send 1200dpi 1bpp data, and if so how to make CUPS do it? Any how to use CUPS's diagnostic tools to help me figure out waht is actually happening?

Thank you!

--
jhawk at alum.mit.edu
John Hawkinson
+1 617 797 0250


More information about the cups mailing list