cups-filters icon indicating copy to clipboard operation
cups-filters copied to clipboard

Can brightness be changed by a filter?

Open Golddouble opened this issue 3 years ago • 10 comments

My printer does not support the settings "brightness", "gamma" and "saturation". I can change this settings, but they have no effect, because my printer does not support these settings. (It's a cheap HP printer. And I use the HPLIP driver. But I also could use driverless-printing.) So I am looking for a method to change "brightness", "gamma" and "saturation" in a different way.

Question: I don't know about filtering, but I think of it somehow like this: First, the file we want to print is packed into a format that is then sent to the printer. But instead of sending the file directly to the printer, it is first sent through a filter, this filter then for example makes everything brighter ("brightness") and only then is the modified file sent to the printer.

Does that work? Which filter could I use to do this?

Would appreciate some answer. Thank you.

Golddouble avatar Mar 14 '21 08:03 Golddouble

The brightness, gamma, and saturation options which there were originally in CUPS are only implemented in the imageto... filters of CUPS (I am not sure whether they were formerly also in the pstops filter). This means that you can use these options when printing image files but not when printing PDFs or out of applications (they send PDF).

tillkamppeter avatar Mar 14 '21 20:03 tillkamppeter

This means that you can use these options when printing image files but not when printing PDFs or out of applications (they send PDF).

Not sure If I understand right:

When I double click a *.jpg in my file manager, then nomacs opens. When I then print, it will print with nomacs and nomacs is an application.

So are you trying to say: "When you print a *.jpg with nomacs, then brightness, gamma, and saturation settings will not work, because nomacs is an application and will send PDF to the printer?

If yes: Do you try to say, that I should print a *.jpg without an application? How can I do that?

Thank you.

Golddouble avatar Mar 14 '21 21:03 Golddouble

To print without application, you use the command line:

lp -d PRINTER -o print-scaling=fill -o gamma=... -o brightness=... -o saturation=... FILE.jpg

AFAIR the brightness/gamma/saturation take integer values in the range of 0-1000, but I am not absolutely sure. See the documentation of CUPS and perhaps also the README of cups-filters.

tillkamppeter avatar Mar 14 '21 21:03 tillkamppeter

Thank you.

I have tried this:

$ lp -o saturation=5 /home/golddouble/Downloads/Druckversuche.png

Output: Request ID is ENVY-5540-series-471 (1 file(s))

Here is the file "Druckversuche.png": Druckversuche

Here is my print (after the print was finished, I have scanned the print): WhatIGot

It is much too dark for a saturation of "5". saturation: possible integer value: 0-200 (default=100)

Very confused. It looks like saturation does not work when printing image files without an application.

(?)

Golddouble avatar Mar 15 '21 09:03 Golddouble

For Saturation you should try a color image, as Saturation describes the color intensity. In case of the allowed range being 0-200 0 should turn your color image into grayscale (the so-called de-saturation, a method to turn color images into grayscale), 100 should leave the color intensity as the original was, and 200 gives some form of over-saturation. And if you print a tiny image for testing, try -o print-scaling=auto or -o print-scaling=none to make the image not getting blown up to the page size and being blurry as there are much less pixels than the printed page has.

tillkamppeter avatar Mar 15 '21 09:03 tillkamppeter

For Saturation you should try a color image, as Saturation describes the color intensity.

Thank you. Then it is useless for me, because I have only a black cartridge in my printer (although it is a colour printer).

I have now made further tries. The following has worked: lp -o scaling=none -o gamma=9000 /home/Golddouble/Downloads/Druckversuche.png (gamma: integer value 1-10'000, default: 1'000)

and lp -o scaling=none -o brightness=200 /home/Golddouble/Downloads/Druckversuche.png (brightness: integer value: 0-200, default: 100)

The brightness, gamma, and saturation options which there were originally in CUPS are only implemented in the imageto... filters of CUPS

Question: Does this mean "brightness, gamma, and saturation" are not filters, but "imageto... " is a filter and "brightness, gamma, and saturation" are only options of the same filter?

Golddouble avatar Mar 15 '21 12:03 Golddouble

Question: Does this mean "brightness, gamma, and saturation" are not filters, but "imageto... " is a filter and "brightness, gamma, and saturation" are only options of the same filter?

Yes, this is exactly the case.

tillkamppeter avatar Mar 15 '21 12:03 tillkamppeter

Thank you.

Question 1 (driverless):

This means that you can use these options when printing image files but not when printing PDFs or out of applications (they send PDF).

But what if I print driverless (AirPrint)? Do then applications also send PDFs?

This means that you can use these options when printing image files but not when printing PDFs or out of applications (they send PDF).

Question 2 (HP-driver): But when I would have a printer, that supports the settings "brightness, gamma, and saturation", then these options would also work, -when printing image files via applications ? -when printing PDFs ? -when printing documents with a mixture of text and images ?

?

Golddouble avatar Mar 15 '21 13:03 Golddouble

An interesting aspect of imagetopdf. Would it be useful to add descriptions of these options (plus hue and colorspace) to the README?

Further treatment of Golddouble's issue is at http://forums.debian.net/viewtopic.php?f=7&t=149001 and OpenPrinting/cups#116

Cheers,

Brian.

debiantriage avatar Mar 29 '21 17:03 debiantriage