sd_load_mask: Load a mask from a PNG file as a 1-channel SD image

View source: R/image_utils.R

sd_load_maskR Documentation

Load a mask from a PNG file as a 1-channel SD image

Description

Reads a PNG and reduces it to a single grayscale channel suitable for inpainting. RGB(A) inputs are averaged across the colour channels; the alpha channel (if any) is ignored.

Usage

sd_load_mask(path)

Arguments

path

Path to a PNG file.

Details

Mask semantics match the engine: white (255) = generate (the inpainted region), black (0) = keep the original pixels.

Value

SD image list (width, height, channel = 1, data as raw vector).


sd2R documentation built on June 19, 2026, 9:08 a.m.