Skip to content

Feature request: Improve lua integration and mask selection for external raster masks #19689

@martinus-523

Description

@martinus-523

Summary

In darktable 5.2, a new module was introduced: external raster masks.
This module is a valuable addition, as it allows users to incorporate external raster masks into their image-editing workflows.

While experimenting with generating external raster masks through a Lua script, I found the current implementation of this module somewhat limited in terms of automation and mask management.

Current Behavior

At the moment:

  • Darktable allows only a single global configuration to define the folder from which external raster masks are loaded.
  • The process of selecting a specific external raster mask within the module cannot be automated through Lua.
  • As the number of masks in the global folder increases, it becomes increasingly difficult to find and select the correct one — especially when multiple raster masks exist for a single image.

Proposed Enhancements

To make the external raster masks module more flexible and scriptable, I propose the following improvements:

  1. Per-image mask folder setting
    Allow the module to define the raster mask folder on a per-image basis, rather than relying on a single global folder.

  2. Lua API integration
    Enable Lua scripts to:

    • Set the raster mask folder for the current image.
    • Select a specific raster mask within the module programmatically.

Example Use Case

A Lua script could:

  • Generate multiple raster masks for a specific image.
  • Output these masks into a dedicated folder associated with that image.
  • Set the External Raster Mask module to point to that folder.
  • Automatically select one of the generated masks.

This would make it much easier for users to manage and switch between multiple masks associated with the same image, directly from within darktable.

Benefits

  • Improved workflow automation through Lua.
  • Easier mask management for complex image editing scenarios.
  • Reduced clutter in the global mask folder.
  • A more consistent and image-centric organization of raster masks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions