image_grayscale
Convert a single image to grayscale.
Parameters
- pathstringone of
pathorsource_key - Source image path
- source_keystringone of
pathorsource_key - Context key containing a source path/object
- output_pathstringrequired
- Destination image path
- formatstringdefault inferred / png
pngorjpeg/jpg- output_keystringdefault "grayscale_image"
- Prefix for output values
Context Output
<output_key>— output file path<output_key>_width/<output_key>_height<output_key>_format<output_key>_success
Example
local flow = Flow.new("image_grayscale_demo")
flow:step("grayscale", nodes.image_grayscale({
path = "examples/fixtures/ironflow-sample.png",
output_path = "output/sample_front_gray.png",
output_key = "gray"
}))
flow:step("log", nodes.log({
message = "Grayscale image: ${ctx.gray_width}x${ctx.gray_height}"
})):depends_on("grayscale")
return flow