darktable-org / darktable-org/darktable
AgX module is applied automatically to 10 bit HEIC images
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 13.1k
- Forks
- 1.4k
- Avg merge
- 22h 14m
- Merged PRs (30d)
- 198
Description
Is there an existing issue for this?
- I checked and did not find my issue in the already reported ones
Describe the bug
If the preference processing>image processing>auto apply pixel workflow defaults is set to scene-refered (AgX), and you import a 10-bit HEIC file, then the AgX module will be activated.
It's possible, even likely, that this behaviour is intentional. I think the AgX module could be quite useful for an image with HDR, but I don't think it should be on by default for the following reasons:
- In the examples I've tried, turning AgX on was not an improvement.
- When AgX is OFF, and the only active modules are output color profile, orientation, and input color profile, the image is displayed in the same way that the system file browser displays the image. This is what I've come to expect for JPEG files, and I think it should be the expectation for all "in camera" processed files.
Steps to reproduce
- Go to "darktable preferences"
- Select "processing"
- Set "auto-apply pixel workflow defaults" to "scene-referred (AgX)".
- Import a 10-bit HEIC file.
- Open the file in darkroom.
- Display the active modules.
- Observe that the AgX module is active.
Expected behavior
The AgX module should not be active.
Logfile | Screenshot | Screencast
I've located where this happens in the code (below), and there's no crash or anything like that, so I don't think a log will be helpful.
I looked at the code and compared the agx.c and sigmoid.c files. The issue is on line 2581 of agx.c:
2570 if(auto_apply_agx)
2571 {
2572 // The scene-referred default preset
2573 _set_scene_referred_default_params(&p);
2574
2575 dt_gui_presets_add_generic(_("scene-referred default"),
2576 self->op, self->version(), &p, sizeof(p),
2577 TRUE, DEVELOP_BLEND_CS_RGB_SCENE);
2578
2579 dt_gui_presets_update_format(BUILTIN_PRESET("scene-referred default"),
2580 self->op, self->version(),
2581 FOR_RAW | FOR_MATRIX | FOR_HDR);
2582 dt_gui_presets_update_autoapply(BUILTIN_PRESET("scene-referred default"),
2583 self->op, self->version(), TRUE);
2584 }
I tried removing the "FOR_HDR" option and recompiling, and I got the behaviour that I expected (the AgX module was NOT automatically activated for a 10 bit HEIC image).
I have attached a screenshot showing:
- on top: the HEIC file opened in GIMP.
- lower left: a darktable snapshot of the HEIC file with AgX OFF.
- lower right: a darktable snapshot of the HEIC file with AgX ON.
You can see that the GIMP version is, as I would expect, much closer to what darktable displays with AgX OFF.
I have also attached a test 10 bit HEIC image, reduced to a reasonable size and zipped.
Commit
No response
Where did you obtain darktable from?
self compiled
darktable version
5.4.0
What OS are you using?
Linux
What is the version of your OS?
Fedora 43
Describe your system
- Wayland
Are you using OpenCL GPU in darktable?
Yes
If yes, what is the GPU card and driver?
AMD RADEON RX 9070 XT, 16 GB, amdgpu
Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip
The issue is still present with an empty/new config dir.
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 at agx.c around line 2581 and compare the scene-referred default preset format flags with sigmoid.c. Rebuild darktable, repeat the listed 10-bit HEIC import steps with AgX defaults enabled, and confirm that AgX is no longer activated automatically while the expected image display remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- computer-vision, desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100