<description>The darktable library is the main entry point for all access to the darktable internals. To access the darktable specific functions you must load the darktable environment:
darktable = require &quot;darktable&quot;
All functions and data are accessed through the darktable module.</description>
<description>function( message : string ) Will print a string to the darktable control log (the long overlaid window that appears over the main panel).
<description>function( message : string ) This function will print its parameter if the Lua logdomain is activated. Start darktable with the &quot;-d lua&quot; command line option to enable the Lua logdomain.
message - string - The string to display. </description>
<description>function( event_type : string, callback : function, ... : variable ) This function registers a callback to be called when a given event happens. Events are documented in the event section.
event_type - string - The name of the event to register to. callback - function - The function to call on event. The signature of the function depends on the type of event. &hellip; - variable - Some events need extra parameters at registration time; these must be specified here.</description>
<description>function( plugin_name : string, name : string, [store : function], [finalize : function], [supported : function], [initialize : function], [widget : types.lua_widget] ) This function will add a new storage implemented in Lua. A storage is a module that is responsible for handling images once they have been generated during export. Examples of core storages include filesystem, e-mail, pwigo&hellip;
<description>function( plugin_name : string, name : string, expandable : boolean, resettable : boolean, containers : table of types.dt_lua_view_t =&gt; [ types.dt_ui_container_t, int ], widget : types.lua_widget, view_enter : function, view_leave : function ) Register a new lib object. A lib is a graphical element of darktable&rsquo;s user interface
plugin_name - string - A unique name for your library name - string - A user-visible name for your library expandable - boolean - whether this lib should be expandable or not resettable - boolean - whether this lib has a reset button or not containers - table of types.</description>
<description>function( type : string ) : types.dt_imageio_module_format_t Creates a new format object to export images
type - string - The type of format object to create, one of :
copy exr j2k jpeg pdf pfm png ppm tiff webp return - types.dt_imageio_module_format_t - The newly created object. Exact type depends on the type passed
<description>function( type : string ) : types.dt_imageio_module_storage_t Creates a new storage object to export images.
type - string - The type of storage object to create, one of:
disk email gallery latex piwigo (Other, lua-defined, storage types may appear.) return - [types.dt_imageio_module_storage_t(../../types/dt_imageio_module_storage_t)] - The newly created object. Exact type depends on the type passed
<description>function( type : string, ... : variable ) : types.lua_widget Creates a new widget object to display in the UI.
type - string - The type of storage object to create, one of:
box button check_button combobox container entry file_chooser_button label section_label separator slider stack text_view &hellip; - variable - Extra parameters, exact value are documented with each type
return - types.lua_widget - The newly created object.</description>
<description>This subtable contains function and data to manipulate the darktable user interface with Lua. Most of these function won&rsquo;t do anything if the GUI is not enabled (i.e you are using the command line version darktable-cli instead of darktable).
🔗darktable.gui.action_images table
A table of types.dt_lua_image_t on which the user expects UI actions to happen. It is based on both the hovered image and the selection and is consistent with the way darktable works.</description>
Guide lines to overlay over an image in crop and rotate. All guides are clipped to the drawing area.
🔗darktable.guides.register_guide function( name : string, draw_callback : function, [gui_callback : function] ) Register a new guide.
name - string - The name of the guide to show in the GUI. draw_callback - function - The function to call to draw the guide lines. [gui_callback] - function - A function returning a widget to show when the guide is selected.</description>
Each existing tag has a numeric entry in the tags table - use ipairs to iterate over them.
🔗darktable.tags.create function( name : string ) Creates a new tag and return it. If the tag exists return the existing tag.
name - string - The name of the new tag. 🔗darktable.tags.find function( name : string ) : types.dt_lua_tag_t Returns the tag object or nil if the tag doesn&rsquo;t exist.</description>
Lua allows you to manipulate preferences. Lua has its own namespace for preferences and you can&rsquo;t access nor write normal darktable preferences. Preference handling functions take a script parameter. This is a string used to avoid name collision in preferences (i.e namespace). Set it to something unique, usually the name of the script handling the preference. Preference handling functions can&rsquo;t guess the type of a parameter. You must pass the type of the preference you are handling.</description>
<description>This pseudo table allows you to access and manipulate styles.
🔗darktable.styles.# types.dt_style_t
Each existing style has a numeric index; you can iterate them using ipairs.
🔗darktable.styles.create function( image : types.dt_lua_image_t, name : string, description : string ) : types.dt_style_t Create a new style based on an image.
image - types.dt_lua_image_t - The image to create the style from. name - string - The name to give to the new style.</description>
<description>Allows to access the currently worked on images, i.e the ones selected by the collection lib. Filtering (rating etc) does not change that collection.
🔗darktable.collection.# types.dt_lua_image_t
Each image in the collection appears with a numerical index; you can iterate them using ipairs.</description>
<description>Allows access to the database of images. Note that duplicate images (images with the same RAW but different XMP) will appear multiple times with different duplicate indexes. Also note that all images are here. This table is not influenced by any GUI filtering (collections, stars etc&hellip;).
🔗darktable.database.# types.dt_lua_image_t
Each image in the database appears with a numerical index; you can iterate over them using ipairs.
<description>This table contain function to manipulate the control flow of lua programs. It provides ways to do background jobs and other related functions
🔗darktable.control.ending boolean
TRUE when darktable is terminating Use this variable to detect when you should finish long running jobs
🔗darktable.control.dispatch function( function : function, ... : anything ) Runs a function in the background. This function will be run at a later point, after luarc has finished running.</description>
This table contains functions related to translating lua scripts
🔗darktable.gettext.gettext function( msgid : string ) : string Translate a string using the darktable textdomain
msgid - string - The string to translate return - string - The translated string 🔗darktable.gettext.dgettext function( domainname : string, msgid : string ) : string Translate a string using the specified textdomain
domainname - string - The domain to use for that translation msgid - string - The string to translate return - string - The translated string 🔗darktable.</description>
This section must be activated separately by calling require darktable.debug
🔗darktable.debug.dump function( object : anything, [name : string], [known : table] ) : string This will return a string describing everything Lua knows about an object, used to know what an object is. This function is recursion-safe and can be used to dump _G if needed.
object - anything - The object to dump. [name] - string - A name to use for the object.</description>