Holger’s Darktable Plugin for Enfuse

Time saving Darktable plugin for HDR and focus stacking

In this episode I take a first look at Holger's lua plugin for stacking. I walk through downloading and installing the lua script to provide a front-end for align_image_stack and enfuse. There are a couple bits along the way that this will smooth over for you.
We then take a quick look at how this works with an image.
Thank you Holger! You've made all our lives easier and our edits more fun.
I've translated Holger's README file into English for you below.

enfuse_pro-2.1beta1.tar @multimedia4linux.de
enfuse_pro-2.1beta1.tar @weeklyedit.com

Sunrise RAW 6 sec
Sunrise RAW 30 sec

Holger’s README in english

Installation on Ubuntu:

1.) First the Lua script language must be installed with the following commands:

sudo apt-get update
sudo apt-get install liblua5.2-0 liblua5.2-dev lua5.2 lua5.2-doc

2.) The program align_image_stack (contained in hugin-tools), enfuse and exiftool is needed for the generation of the HDR and DFF (Focus Stacking) images. Install it with:

sudo apt-get install hugin-tools enfuse libimage-exiftool-perl

(added by Harry) You may also require upgrading your enfuse to 4.2

sudo add-apt-repository ppa:hugin/hugin-builds
sudo apt-get update
sudo apt-get upgrade

3.) If not already present, create the following directories:


4.) Copy the Lua script enfuse_pro.lua


5.) To start the script the luarc file has to be created or edited. The text file ~/.config/darktable/luarc has to be opened or created with a text editor.
Add the following to the luarc file:

require "contrib/enfuse_pro"

After a reboot of darktable the plugin under the name "fusion to hdr or dff image" should appear in the target storage options of the export function.

In the global presets under the tab Lua Options there are further settings for the plug-in.

PS: The script only works when you start Darktable normally from the menu or from the terminal window when you are in your home directory. If you are not in the home directory, align_image_stack saves the images to an incorrect location and enfuse will not find you!

Have fun

12 thoughts on “Holger’s Darktable Plugin for Enfuse

  1. After sometimes on it :
    ref to : https://www.darktable.org/usermanual/ch09.html.php
    I found we can troubleshoot lua script by starting darktable in CLI with “-d lua” so lua debug msg are returned , and some tests can be done to be sure lua scripts are working as expected .
    So the error msg was :
    LUA ERROR : /home/hubpliss/.config/darktable/luarc:1: syntax error near char(226)
    Creating the luarc file , i copy/paste from firefox require “contrib/enfuse_pro”
    After some tests , seems a character become invalid during the paste ( probably the double quote)
    I am using a french Ubuntu and Darktable in french , it can be the root cause .
    I wrote the command manually (require “contrib/enfuse_pro”) and all is fine now 🙂 .


  2. Hello Holger , i followed your procedure step by step and restarted Darktable , But no new export option about fusion 🙁 .
    In addition the setting windows doesn’t contain a tab for the lua option .
    how can i start a troubleshooting about this issue ?


    • I hadn’t used the hugin.lua plugin. Thanks for pointing that out to me. At first look, the hugin.lua plugin saves the images and opens them in hugin. From that point, you work in Hugin’s interface.

      Holger’s plugin stays inside of Darktable and allows finer control of both align_image_stack and enfuse. But doesn’t offer the option to use cpfind or celeste. Kind of different uses. Also you can do focus stacking with Holger’s plugin. I use that a lot. As a matter of fact, since I usually bracket either shutter speed or focal length, I’ve been using this plugin quite a bit.

    • In general, you can use any number of images with exposure fusion. I would guess that the scripts also support fusing more than two images.

    • Thanks for the clarification. You are, of course, right about that. But the results with a 14 stop sensor can be very similar in many cases.

      • Right.
        When you compare the result of a tonemapped HDR file to a exposure fused file, the results can be very similar.

        But instead of transforming into a high high-bit image, exposure fusion basically computes a weight mask of how strongly each of the pixels in the input images influence the value of the output image.

  3. Pingback: Weekly Edit 30: Plugin darktable Holger pour Enfuse – darktable FR

Leave a Reply

Your email address will not be published.