OpenPrinting / cups-filters

filters, backends, driverless utility, ... - Everything which CUPS 2.x needs to be used on non-Mac systems
Apache License 2.0
151 stars 122 forks source link

Can brightness be changed by a filter? #352

Open Golddouble opened 3 years ago

Golddouble commented 3 years ago

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.

tillkamppeter commented 3 years ago

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).

Golddouble commented 3 years ago

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.

tillkamppeter commented 3 years ago

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.

Golddouble commented 3 years ago

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.

(?)

tillkamppeter commented 3 years ago

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.

Golddouble commented 3 years ago

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?

tillkamppeter commented 3 years ago

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.

Golddouble commented 3 years ago

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 ?

?

debiantriage commented 3 years ago

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.

Golddouble commented 1 month ago

Quote from tillkamppeter:

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).

Quote from Golddouble:

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?

I have tried this out now. I have changed the brightness filter from 100 to 200 here (Xfce printer settings): image

After I have printed a picture with the nomacs App.

As you have said, this has not changed the brightness, because nomacs is an App. and Apps use PDF for printing and the filter only has an effect, if we print a picture via command in a terminal.

But then I ask me for what purpose is the setting brightness in the red frame above good for? I do not see any scenario when it has an effect then. Is this setting only a dummy?

Would appreciate some answer. Thank you.