-
Notifications
You must be signed in to change notification settings - Fork 115
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
Added UltraHDR export plugin to generate UltraHDR JPEG images. #502
Conversation
I/m not sure how to use this. I read the header comment and it says I need to provide a jpg image and a gainmap image. I read the ultrahdr_app documentation and it says I need to supply an SDR image and an HDR image. Could you please provide a workflow that I can use to test this? Thanks |
The script is using the API-4 encoding variant, i.e. one that expects a JPEG SDR and a JPEG gainmap on input, both of which can be created quite easily in darktable. In hindsight, I probably should make this clear in the UI as well.
https://discuss.pixls.us/t/manual-creation-of-ultrahdr-images/45004/12 |
I added a combobox in UI for choosing the encoding variant, so that user knows what the required inputs are. Adding new encoding variants in the future (e.g. SDR and HRD -> UltraHDR) will now be easier. |
I changed the plugin to appear as a lib (prevously it was an export storage plugin), cleaning up the UI, adding more descriptions, tooltips, and exposing preferences. I also added support for generating UltraHDR images from SDR + JPEG-XML HDR image pairs. https://www.youtube.com/watch?v=q5hrx2E7BL4 demonstrates generating UltraHDR JPEGs from SDR + monochrome gainmap pairs. The biggest challenge for plugin users is that is requires compiling @wpferguson, LMK if this passes the bar for lua-scripts |
I'm trying to run this in a completely new environment. I have an SDR raw and I duplicated it and created a gainmap. I select option 1 (SDR + Gainmap) and use original location. I hit the button to run it and it crashes in option 2.
I hovered all the widgets looking for tooltips to tell me what is wrong or what I'm missing, but I didn't get enough information to figure it out. |
I fixed the crash, thanks! And many other errors that are obvious when running the plugin on a clean profile 😅
EDIT: The Now the only required setting on fresh install on most distros should be to choose the |
Saw your comment on pixls. I've been pretty swamped lately trying to get everything done for feature freeze. Since feature freeze I've been updating the docs and triaging issues. If you think this is ready, push your changes and I'll go over it this week. |
No worries @wpferguson, I'm not pressed for time here. I am using this plugin already and consider it stable-enough (there's no bugs I'm aware of), though obviously it's hard to tell how universal the workflow(s) in the plugin would be for other users. I'll leave the decision on whether to merge to |
contrib/hif_group_leader translation safe contrib/jpg_group_leader
for use as a unique identifier.
images. Fixed comment.
According to comments and https://docs.darktable.org/usermanual/4.6/en/special-topics/variables/ it should be a basename.
Accd to https://github.com/darktable-org/darktable/blob/57d3ad4bd30372b1f7ae7368f6887d3292269b2a/src/common/variables.c#L660 it should be a basename of the file path.
Variable substitution actually errored out when duplicates were present.
Did some testing... When I test I clone the latest copy of darktable master and compile it. I pull the latest master from the lua scripts. Then I pull the PR into a test branch in the lua scripts directory. First test:
Second test:
|
…s supported now).
Changed config defaults to require less user input (use_original_directory=TRUE, import_to_darktable=TRUE). Account for nil values when checking for file existence.
Fixed pref load / saving code defaults. Metadata file is required in ENCODING_VARIANT_SDR_AUTO_GAINMAP mode.
…ge in a stack will be used, vs the last one).
Was that If it's not that, IDK what happened :/
I only have 4.8.1 here, but starting on that version afresh seems to work (up to the point of enabling the plugin without errors):
I can't reproduce this on 4.8.1/MacOS Sequoia 15.1.1 + Homebrew libultrahdr 1.3.0
File was generated with no errors in the UI, stdout shows only expected output. All the binaries were already in the path, so I didn't have to configure them.
I'll look into reproducing on prebuilt DT master + fixing the log outputs. |
I checked out release-4.8.1 and compiled that then tested. Much better, but now I'm wondering what's broken in master
I'm guessing I probably need to update my ultrahdr_app copy. |
Yes, |
Got it to work with updated libultrahdr and using 4.8.1. Now I'm going to chase what's going on with export in master |
One potential culprit might be https://github.com/darktable-org/lua-scripts/pull/502/files#diff-964234d8155307277adf239627f3dc0d579d0c2b6669adb192e3d168cc3a9e17R419-R420, I remember some gboolean change wasn't completed in DT, there was some pending work. The symptoms would be indeed that a temporary file is correctly created, then the export succeeds, but the plugin reports it as failing, and a file gets deleted afterwards. |
My hunch was correct - it's darktable-org/darktable#17528. I'll update the PR with the new logging code and an updated workaround condition. In 9.3.0 and 9.4.0, I'll treat |
With the workaround code I can now generate UltraHDRs with the same reproduction steps on 4.9.0+1181~gfa54963782-dirty (still MacOS). |
I added an issue and a fix darktable-org/darktable#17938, darktable-org/darktable#17939. It's really LATE in the release cycle, so we'll see if it gets merged. |
The fix is in, so we can test for sane return values. |
Done. The workaround for write_image return value is now only applied in 9.3.0. |
@koto the only thing I'm waiting on is the changes I flagged in the code. Once those are done I'm ready to merge. |
I don't see any review comments in the PR, did you mean the changes with the log levels in each function? These are already in. |
The old profile still seems to be used occasionally without the sleep.
I went through the file and commented on things that needed changed, such as not translating debug messages, but none of the changes I requested have been made. Are you looking at the PR on github (#502), or just getting emails and responding to them? |
On GitHub. I don't see any review comments, only this conversation :/ Can you double check the comments were submitted? |
My fault. I didn't hit the correct button. |
Looks like everything in addressed now then :) |
Could you write a page for the Lua scripts manual, https://docs.darktable.org/lua/stable/lua.scripts.manual/? |
No description provided.