lua-scripts icon indicating copy to clipboard operation
lua-scripts copied to clipboard

added script to integrate workflow for Helicon Focus stacking software

Open ChristianBirzer opened this issue 3 years ago • 9 comments

I've created a script to integrate Helicon Focus stacking software into darktable.

I'm not sure if it's ok to submit this in the dt contrib repo since it's about integrating a commercial application. On the other hand, there might be other users that use this software too. So you decide. If you think it doesn't belong there you still can reject it 😉

Since it's my first 'complete' script there might also be some errors or missing things. I already planned to support translations but didn't implement it so far. German translation will come for sure tough.

grafik

BTW: Using the external editor script wasn't an option for me because Helicon Focus has very sophisticated command line parameters to pass input images and get results back what I wanted to make use of.

ChristianBirzer avatar Mar 13 '22 12:03 ChristianBirzer

Thank you @ChristianBirzer for this handy script, it makes working with Darktable together with Helicon Focus so much more fun.

I played around a bit with it and found a bug in the group feature: Only the first selected, the last selected and the stacked image are part of the newly created group but not the other selected images that were used to create the focus stack.

I have a feature request: In probably >95% of the times the location of the executable of Helicon Focus is "C:\Program Files\Helicon Software\Helicon Focus 8\HeliconFocus.exe" (were the 8 might change over time) on Windows. The script could check on startup/install/stackbuttonclick if HF is installed on that default location and if that's the case, set the property Helicon Focus executable to that value (but only if the property is not already set).

And finally: When Helicon Focus executable is not set but the users clicks "stack" a unspecific error message appears. It would be great if in that case the error message would tell the user that they have to go to the preferences and set a path for Helicon Focus executable.

Again, thank you very much for this great script.

mfg92 avatar Mar 20 '22 13:03 mfg92

@mfg92 thanks a lot for your feedback and testing! I'll work through your suggestions the next days.

ChristianBirzer avatar Mar 20 '22 16:03 ChristianBirzer

I have a feature request: In probably >95% of the times the location of the executable of Helicon Focus is "C:\Program Files\Helicon Software\Helicon Focus 8\HeliconFocus.exe" (were the 8 might change over time) on Windows. The script could check on startup/install/stackbuttonclick if HF is installed on that default location and if that's the case, set the property Helicon Focus executable to that value (but only if the property is not already set).

lib/dtutils.file has a function, check_if_bin_exists, which will search the windows program directories for executable. You just need to supply the name without the .exe extension. If/when it's found the location will be saved to the darktablerc file so that the search doesn't have to be performed in the future.

If the file is not found, out can add a widget to your UI using the lib/dtutils.file function executable_path_widget which adds file selector widgets for each executable you specify. The user selects the file, which is stored in the darktablerc, so the next check to check_if_bin_exists() will return the path.

wpferguson avatar Mar 20 '22 17:03 wpferguson

@ChristianBirzer

I'm not sure if it's ok to submit this in the dt contrib repo since it's about integrating a commercial application.

Scripts interfacing to commercial applications wont be merged. However...

  • you can maintain your own repository of scripts that won't/can't be accepted into the lua-scripts repository and we can add a link in the README.md on this repository. In fact, I maintain just such a repository of scripts that didn't get merged, or wont be merged, or are a work in progress but useful (https://github.com/wpferguson/extra-dt-lua-scripts)
  • we can leave this open for awhile if you want to gather comments and feedback.

wpferguson avatar Mar 20 '22 17:03 wpferguson

Scripts interfacing to commercial applications wont be merged. However...

I expected this answer... But I love the idea of having a own (mini) repo with this script and get a link to it. Thanks! I'll prepare this as soon as I added the suggestions above.

Afterwards I'll close this PR.

ChristianBirzer avatar Mar 20 '22 18:03 ChristianBirzer

Just found another bug, @mfg92 maybe you could verify this: The call to Helicon Focus gets the preferred output path set to the path of the first input image. But this does not work when the path contains a german umlaut. On the console I see that path seems to have a wrong encoding. grafik However, the same image paths written to a text file (for the input images for Helicon) works fine.

The same problem occurs with other scripts like the "OpenInExplorer": Images in directories containing Umlauts are not working. I guess this is a more general problem (or only on my setup?)

ChristianBirzer avatar Mar 22 '22 20:03 ChristianBirzer

For me folders with umlauts are working correctly in "OpenInExplorer" as well as in your script, if I am using my self compiled version of darktable from MSYS terminal. If I start the offical darktable installation both do NOT work as expected.

mfg92 avatar Mar 23 '22 08:03 mfg92

If I start the offical darktable installation both do NOT work as expected.

Thanks a lot for testing. I guess this is worth a new issue or at least a note in the manual... (but I'm not sure if its lua or dt related). I found out that it works fine when I activate the Unicode support in the Region settings (Control Panel -> Language -> Administrative language settings -> Administrative -> Change system locale grafik I was very surprised to see that UTF-8 support is marked as "Beta" in Windows 10 "Pro" from the year 2021 😱

ChristianBirzer avatar Mar 23 '22 17:03 ChristianBirzer

Hi, I started to host this script in my own repository. Not completely finished, but should be working so far.

https://github.com/ChristianBirzer/darktable_extra_scripts

ChristianBirzer avatar Mar 27 '22 17:03 ChristianBirzer

Added link to your scripts

wpferguson avatar Mar 25 '23 17:03 wpferguson