darktable Lua scripts
repository·master·Indexed 42 days ago
https://github.com/darktable-org/lua-scriptsA collection of official, community-contributed, and example Lua scripts for darktable. This repository provides extended functionality, automation, and tools through the darktable Lua scripting interface, including scripts for metadata management, HDR blending, facial recognition, and API demonstration.
What's inside darktable Lua scripts
- darktable can be customized and extended using the Lua programming language. This repository serves as a collection of official scripts maintained by darktable developers, contributed scripts from the community, example scripts for API demonstration, and tools for managing the repository and documentation.
Disable Lua scripts
masterTo disable a specific script, open yourluarcfile in a text editor and insert--at the beginning of the line containing the script you wish to disable. This uses standard Lua comment syntax.Install the Lua scripts repository
masterThe recommended installation method is to clone the repository using
gitinto your darktable configuration directory. This ensures dependencies are met and allows for easy updates. Note that AppImage packages do not support Lua scripts as they lack an internal Lua interpreter.Select the command corresponding to your installation method:
- Snap: Clone into
~/snap/darktable/current - Flatpak: Clone into
~/.var/app/org.darktable.Darktable/config/darktable - Linux/MacOS: Clone into
~/.config/darktable/ - Windows: Clone into
%LOCALAPPDATA%\darktable(ensure darktable has been run at least once to create this directory).
# Example for Linux/MacOS cd ~/.config/darktable/ git clone https://github.com/darktable-org/lua-scripts.git lua # Example for Windows (Command Prompt) cd %LOCALAPPDATA%\darktable git clone https://github.com/darktable-org/lua-scripts.git lua- Snap: Clone into
Update the Lua scripts repository
masterTo update your installed scripts, navigate to the
luadirectory within your darktable configuration folder and perform agit pull.# Example for Linux/MacOS cd ~/.config/darktable/lua/ git pullEnable Lua scripts via luarc
masterDarktable loads scripts by reading a plain text file named
luarclocated in your darktable configuration directory. Each line in the file must follow the formatrequire "<directory>/<name>".Recommended Approach: Enable the
script_managermodule, which provides a UI for managing scripts.Manual Approach: You can create or append to the
luarcfile using command-line tools likeecho.Configuration Locations:
- Linux/MacOS:
~/.config/darktable/luarc - Windows:
%LOCALAPPDATA%\darktable\luarc - Snap:
~/snap/darktable/current/luarc - Flatpak:
~/.var/app/org.darktable.Darktable/config/darktable/luarc
# Enable script manager on Linux/MacOS echo 'require "tools/script_manager"' > ~/.config/darktable/luarc # Add a specific script (e.g., hugin) on Windows echo require "contrib/hugin" >> %LOCALAPPDATA%\darktable\luarc- Linux/MacOS:
Debug Lua scripts
masterIf scripts are not behaving as expected, you can run darktable with Lua debugging enabled to see detailed information in the terminal or a log file.
Commands by Platform:
- Snap:
snap run darktable -d lua - Linux:
darktable -d lua - MacOS:
/Applications/darktable.app/Contents/MacOS/darktable -d lua - Windows:
"C:\Program Files\darktable\bin\darktable" -d lua > log.txt(run from a command prompt)
# Linux debugging darktable -d lua- Snap:
Access Lua script and API documentation
masterThe project provides several documentation resources:
- Lua Scripts Manual: Documentation for specific scripts (transcribed from header comments).
- Lua Scripts Library API Manual: Documentation for the libraries and functions provided by the scripts.
- Lua API Manual: Documentation for the core darktable Lua API.
- Darktable User Manual: General information about scripting with Lua.
Reference of Tool scripts
masterTool scripts perform functions related to the repository, such as generating documentation. They are located in the
tools/directory.Name Standalone OS Purpose executable_managerYes LMW Manage the external executables used by the lua scripts gen_i18n_moNo LMW Generate compiled translation files (.mo) from source files (.po) get_lib_manpagesNo LM Retrieve the library documentation and output it in man page and PDF format get_libdocNo LMW Retrieve the library documentation and output it as text script_managerNo LMW Manage (install, update, enable, disable) the lua scripts Reference of Contributed darktable scripts
masterContributed scripts are maintained by community members and are located in the
contrib/directory. They are categorized by whether they areStandaloneand their supported Operating Systems (L: Linux, M: MacOS, W: Windows).Name Standalone OS Purpose AutoGrouperYes LMW Group images together by time autostyleYes LMW Automatically apply styles on import auto_tag_modifiedYes LMW Automatically tag images which have been manually modified in the darkroom change_group_leaderYes LMW Change which image leads group clear_GPSYes LMW Reset GPS information for selected images CollectHelperYes LMW Add buttons to selected images module to manipulate the collection color_profile_managerYes LMW Manage darktable input and output color profiles copy_attach_detach_tagsYes LMW Copy and paste tags from/to images cr2hdrYes L Process image created with Magic Lantern Dual ISO cycle_group_leaderYes LMW cycle through images of a group making each the group leader in turn dbmaintYes LMW find and remove database entries for missing film rolls and images enfuseAdvancedNo LMW Merge multiple images into Dynamic Range Increase (DRI) or Depth From Focus (DFF) images exportLUTYes LMW Create a LUT from a style and export it ext_editorNo LW Export pictures to collection and edit them with up to nine user-defined external editors face_recognitionNo LM Identify and tag images using facial recognition fujifilm_dynamic_rangeNo LMW Correct fujifilm exposure based on exposure bias camera setting fujifilm_ratingsNo LM Support importing Fujifilm ratings geoJSON_exportNo L Create a geo JSON script with thumbnails for use in ... geoToolboxNo LMW A toolbox of geo functions gimpNo LMW Open an image in GIMP for editing and return the result gpx_exportNo LMW Export a GPX track file from selected images GPS data harmonic_armatureYes LMW provide a harmonic armature guide hif_group_leaderYes LMW change the group leader in a raw+heif image pair to the heif image HDRMergeNo LMW Combine the selected images into an HDR DNG and return the result huginNo LMW Combine selected images into a panorama and return the result image_stackNo LMW Combine a stack of images to remove noise or transient objects image_timeYes LMW Adjust the EXIF image time jpg_group_leaderYes LMW change the group leader for a raw+jpg pair to the jpg image kml_exportNo L Export photos with a KML file for usage in Google Earth LabelsToTagsYes LMW Apply tags based on color labels and ratings OpenInExplorerNo LMW Open the selected images in the system file manager passport_guideYes LMW Add passport cropping guide to darkroom crop tool passport_guide_germanyYes LMW Add passport cropping guide for German passports to darkroom crop tool pdf_slideshowNo LM Export images to a PDF slideshow photilsNo LM Automatic tag suggestions for your images quicktagYes LMW Create shortcuts for quickly applying tags rate_groupYes LMW Apply or remove a star rating from grouped images rename_imagesYes LMW Rename single or multiple images rename-tagsYes LMW Change a tag name RL_out_sharpNo LW Output sharpening using GMic (Richardson-Lucy algorithm) select_non_existingYes LMW Enable selection of non-existing images in the the currently worked on images select_untaggedYes LMW Enable selection of untagged images slideshowMusicNo L Play music during a slideshow transfer_hierarchyYes LMW Image move/copy preserving directory hierarchy video_ffmpegNo LMW Export video from darktable website_gallery_exportNo LMW Export a website gallery for selected images Reference of Example scripts for API demonstration
masterExample scripts are located in the
examples/directory. They are intended for demonstration purposes to show how to use specific portions of the darktable Lua API. They are categorized by whether they areStandaloneand their supported Operating Systems (L: Linux, M: MacOS, W: Windows).Name Standalone OS Purpose api_versionYes LMW Print the current API version darkroom_demoYes LMW Demonstrate changing images in darkroom gettextExampleYes LM How to use translation gui_actionsYes LMW demonstrate controlling the GUI using darktable.gui.action calls hello_worldYes LMW Prints hello world when darktable starts lighttable_demoYes LMW Demonstrate controlling lighttable mode, zoom, sorting and filtering moduleExampleYes LMW How to create a lighttable module multi_osNo LMW How to create a cross platform script that calls an external executable panels_demoYes LMW Demonstrate hiding and showing darktable panels preferenceExamplesYes LMW How to use preferences in a script printExamplesYes LMW How to use various print functions from a script running_osYes LMW Print out the running operating system x-touchYes LMW demonstrate how to use an x-touch mini MIDI controller to control the darktable GUI Reference of Official darktable scripts
masterOfficial scripts are maintained by darktable developers and are located in the
official/directory. They are categorized by whether they areStandalone(can be run by themselves) and their supported Operating Systems (L: Linux, M: MacOS, W: Windows).Name Standalone OS Purpose check_for_updatesYes LMW Check for updates to darktable copy_paste_metadataYes LMW Copy and paste metadata, tags, ratings, and color labels between images delete_long_tagsYes LMW Delete all tags longer than a specified length delete_unused_tagsYes LMW Delete tags that have no associated images enfuseNo L Exposure blend several images (HDR) generate_image_txtNo L Generate txt sidecar files to be overlaid on zoomed images image_path_in_uiYes LMW Plugin to display selected image path import_filter_managerYes LMW Manager for import filters import_filtersNo LMW Two import filters for use with import_filter_manager save_selectionYes LMW Provide save and restore from multiple selection buffers selection_to_pdfNo L Generate a PDF file from the selected images