Skip to content

16 bit CUPS print pipeline for printer profiled prints - #22090

Merged
TurboGit merged 6 commits into
darktable-org:masterfrom
Cjhemmer:CUPS_working
Aug 31, 2026
Merged

16 bit CUPS print pipeline for printer profiled prints#22090
TurboGit merged 6 commits into
darktable-org:masterfrom
Cjhemmer:CUPS_working

Conversation

@Cjhemmer

Copy link
Copy Markdown
Contributor

Currently the print pipe on darktable handles use of an .icc printer (paper) profile through the color transform as 16 bit, but returns just an 8 bit encoded image, which is then processed through CUPS as an 8 bit PDF. This code maintains 16 bit per channel (48 bit/pixel) color fidelity all the way to the printer provided a printer profile has been set.

I have tested this on a Canon MF8200 all in one color laser printer and Epson ET-8550 color inkjet with both jpeg and raw image formats through both the printer managed (8 bit pipeline) and printer profiled (16 bit pipeline) with success. Those are the only two physical printers accessible to me and I do not know what would happen with older equipment or non-CUPS drivers. So there is possibility of regression here that should be tested.

This PR relates to PR #21988 in that some of the changes here are also needed to provide a 16 bit pipeline for Windows printing, notably those in printprof.c and those changes alone would break profiled printing on Linux (I tested and got corrupted output) and presumably MacOS. If this PR is decided to not be merged, I can still make Windows printing work, but like with CUPS would be 8 bit to the printer once it leaves the LittleCMS color conversion for the .icc profile.

@Cjhemmer
Cjhemmer marked this pull request as ready for review August 30, 2026 22:18
@ralfbrown ralfbrown added feature: new new features to add scope: print all cups and printing related issues labels Aug 31, 2026
Comment thread src/libs/print_settings.c Outdated
Comment thread src/libs/print_settings.c Outdated
@TurboGit

Copy link
Copy Markdown
Member

notably those in printprof.c and those changes alone would break profiled printing on Linux

Can you clarify? You said that this was tested to be ok and then here "those changes alone" would break something? Probably my English is not good enough to follow :) TIA.

@Cjhemmer

Copy link
Copy Markdown
Contributor Author

notably those in printprof.c and those changes alone would break profiled printing on Linux

Can you clarify? You said that this was tested to be ok and then here "those changes alone" would break something? Probably my English is not good enough to follow :) TIA.

I realized I may have been unclear rereading my original comment. When I say it broke the linux printing, there were one other hard coded location where bpp was not being honored, - line 481 in print_settings which resulted in a truncated buffer being sent on to pdf.c (1/4 of the image would print). In addition, when I fixed that, two additional issues were triggered. PDF.c is set up to handle 16 bit it just couldn't receive a 16 bit buffer due to the uint16_t to unsigned char cast that came back as a compile error. The other is the little vs big endian swap needed. So in the end, what I had hoped would have been a handful of lines of code ended up being a little bit more.

@Cjhemmer
Cjhemmer requested a review from TurboGit August 31, 2026 15:46
@TurboGit

Copy link
Copy Markdown
Member

Ok, tested and works for me. Can you please add a release note entry? This is a new requirement for merging PR. See #22048. TIA.

@Cjhemmer

Copy link
Copy Markdown
Contributor Author

Updated the RELEASE_NOTES.md with a line item, placed in a similar location I see other notes have been added at the end of ## Other Changes

@TurboGit
TurboGit merged commit 5439386 into darktable-org:master Aug 31, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: new new features to add release notes: pending scope: print all cups and printing related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants