darktable-org / darktable-org/darktable
[FR] A solution to better image rendering and HDR display output without GTK migration
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 13.1k
- Forks
- 1.4k
- Avg merge
- 22h 14m
- Merged PRs (30d)
- 198
Description
Is your feature request related to a problem? Please describe.
One thing I heard why HDR display is impossible at the moment is due to GTK3 being used. But there is a simple solution which doesn't require migration and is adopted by other applications like Lightroom and Resolve. That will also improve rendering accuracy in general.
Describe the solution you'd like
The solution is to use native rendering surfaces for each OS instead of GTK/Cairo. This is how it works in Adobe and Black Magic software.
As far as I understood the code (haven't written any C/C++ in over a decade, so I'm very rusty, sorry), the rendering canvas is already a stand alone component which uses Cairo. It can be replaced with an OS native surface (like DX11 for Windows, Metal or whatever for MacOS, etc) and render the image using all available tools, like 10 bit output, wide gamut support, HDR support, etc. This code will also be beneficial after GTK4 migration as I don't believe GTK4 supports any advanced colour management features from all OSes.
The workflow I see in my head is as follows:
- Detect image buffer requirements for current OS (8/10 bit, colour gamut, HDR support).
- Update renderer into buffer to use the expected data format.
- Replace Cairo surface with a native surface.
- Draw image buffer into native surface.
Cairo can still be used as a fallback for unsupported systems, like older Windows versions without ACM and HDR support or Linux distros running outdated stuff.
I can try and provide some assistance for Windows side of things, but since I haven't touched C/C++ in a long while I will definitely need some guidance navigating the code base. A good code example for Windows is dogegen (pattern generator for colour calibration).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the standalone rendering canvas and its Cairo surface, then review how image buffers and OS-specific surfaces would be handled on Windows and macOS. Define the supported 8/10-bit, wide-gamut, and HDR formats plus the Cairo fallback; done means native rendering works where supported without requiring GTK migration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cpp
- Domain
- computer-graphics, desktop-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100