Home / Lua API Manual / darktable / darktable.styles
< darktable.destroy_storage
darktable.tags >

# darktable.styles

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 - string - The description of the new style.
- return - types.dt_style_t - The new style object.

# 🔗darktable.styles.delete

    function(
      style : types.dt_style_t
    )

Deletes an existing style.

- style - types.dt_style_t - the style to delete

# 🔗darktable.styles.duplicate

    function(
      style : types.dt_style_t,
      name : string,
      description : string
    ) : types.dt_style_t

Create a new style based on an existing style.

- style - types.dt_style_t - The style to base the new style on.
- name - string - The new style’s name.
- description - string - The new style’s description.
- return - types.dt_style_t - The new style object.

# 🔗darktable.styles.apply

    function(
      style : types.dt_style_t,
      image : types.dt_lua_image_t
    )

Apply a style to an image. The order of parameters can be inverted.

- style - types.dt_style_t - The style to use.
- image - types.dt_lua_image_t - The image to apply the style to.

# 🔗darktable.styles.import

    function(
      filename : string
    )

Import a style from an external .dtstyle file

- filename - string - The file to import

# 🔗darktable.styles.export

    function(
      style : types.dt_style_t,
      directory : string,
      overwrite : boolean
    )

Export a style to an external .dtstyle file

- style - types.dt_style_t - The style to export
- directory - string - The directory to export to
- overwrite - boolean - Is overwriting an existing file allowed

< darktable.destroy_storage
darktable.tags >