Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let the PPD Generator read color spaces and color depth correctly from IPP data #5227

Closed
wants to merge 2 commits into from
Closed

Conversation

tillkamppeter
Copy link

The PPD generator did not support all combinations of color spaces and color depths when reading the information from the answer to the get-printer-attributes IPP request. especially if in Apple Raster a range of color depths is given for a color space, like "W8-16", "ADOBERGB24-48", ... Now support for a color space in any color depth is recognized and the highest depth available chosen for each color space.
On my DeskJet 2540 this was especially leading to the fact that only the standard RGB color space appeared in the "ColorModel" option and not the also supported Gray and AdobeRGB color spaces. These two color spaces also print perfectly on the printer with 16 bit color depth (with CUPS 2.3b2).

HP-DeskJet_2540-ipp-attr-ippserver.txt

…m IPP data

The PPD generator did not support all combinations of color spaces and
color depths when reading the information from the answer to the
get-printer-attributes IPP request. especially if in Apple Raster a
range of color depths is given for a color space, like "W8-16",
"ADOBERGB24-48", ... Now support for a color space in any color depth
is recognized and the highest depth available chosen for each color
space.
@michaelrsweet
Copy link
Collaborator

We cannot accept this pull request as-is.

First, defaulting to the highest bit depth will lead to serious performance regressions. This is not something we will change our minds on - high bit depth for AdobeRGB is OK (and expected), but not for the others.

Second, sRGB is only defined for 24-bit (8-bit per component). Higher bit depth sRGB is actually a different color space (scRGB, defined by HP and Microsoft) as none of the "tweaks" employed for 16-bit and 24-bit sRGB are valid for higher bit depths. scRGB never caught on and we don't support it "natively".

Finally, we will consider supporting 24-bit AdobeRGB, but despite the wider gamut you lose a lot of color resolution so the results are often worse than for 24-bit sRGB. For that reason we don't actually allow 24-bit AdobeRGB with Apple Raster, but if a printer is reporting support for it we might bend the rules for that...

Changes:

If there is only one color depth offered by the printer, this depth is
used, regardless whether it is 8 or 16 bit.

If there are both 8 and 16 bit offered, in case of sRGB we default to
8 bit, in case of AdobeRGB to 16 bit, and in case of Grayscale two
entries, one for 8 bit and one for 16 are created.
@tillkamppeter
Copy link
Author

Thanks for the info, I simply purely followed the output of the printer on get-printer-attributes and also that CUPS, cups-filters and the printer are handling the color depths correctly.
Now I have taken your answer into account, in case of the printer offering both 8 and 16 bit for a color space defaulting to 8 bit for sRGB and 16 bit for AdobeRGB, and creating two choices for Grayscale. If the printer offers only one color depth for a color space, this depth is simply taken.
Important is also that all Black, Grayscale, sRGB, and AdobeRGB color spaces reported by the printer are recognized and especially entries in the URF info string which have two color depths.
I am ignoring DeviceGray and DeviceRGB color spaces as I do not know about how they behave color-management-wise.

@michaelrsweet
Copy link
Collaborator

[master c283f46] Add support for deep grayscale (ColorModel=Gray16) and 8-bit AdobeRGB (Issue #5227)

@tillkamppeter
Copy link
Author

I have tested your change now and on my printer at least it provides the same options as my change. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants