logoalt Hacker News

ValdikSStoday at 1:21 AM3 repliesview on HN

>penguin would shrink the result to fit its screen. >I declared A5 and Letter paper, media type stationery, and an output bin called face-up.

You can (and should!) define exact dimensions of your screen in `media-size-supported`. It will probably be a non-standard IPP name, that's why you should define that in `media-supported` as `om_NNNmmxYYYmm` or `oe_NNNinxYYYin`

That way you don't need to scale the incoming data, the PC will format it exactly to the dimensions of the screen.

Both PWG Raster and Apple Raster support 1-bit-per-pixel mode (instead of 8-bit-per-pixel you use), that's why the input could be 8 times less in size. Use `print-color-mode-{supported,default}=bi-level` instead of `monochrome` for that. And also tune `urf-supported`'s `W` option, use `W1` for this case.

The screen/dithering could be ass in 1-bit mode, see https://github.com/OpenPrinting/libcupsfilters/pull/160 where I added more dithering options (Linux-only though, Apple seems to abandon their CUPS).


Replies

Neywinytoday at 1:53 AM

This is why I like it here. Somebody does irrefutably incredible work outside of their comfort zone, and somebody else goes "yeah actually I was born in that zone. Moulded by it. Here's how to improve it" (in a positive way)

show 1 reply
cat-whisperertoday at 1:48 AM

lovely, this would save me a bunch of memory during transformation and dithering. Will do!

darkvision77today at 7:47 AM

> Use `print-color-mode-{supported,default}=bi-level` instead of `monochrome` for that

The last time I checked (a year ago), 1bpp was suddenly supported only by Windows. IIRC, monochrome is REQUIRED, while bi-level is OPTIONAL in RFC.

Not sure how things stand now, though. Ever since then, I've just been carrying Floyd–Steinberg dithering around.