Files
imagepipeline/pipelines/example_grayscale.py
T
Frank Schwenk a60a18a253 chore: add Ruff and apply formatting across codebase
Introduce ruff lint/format config, expand .gitignore, and reformat Python sources.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-18 17:34:14 +02:00

32 lines
881 B
Python

#!/usr/bin/env python3
"""Example pipeline: convert all exported images to grayscale."""
from pathlib import Path
from imagepipeline import Pipeline
# Change this to your Darktable export folder.
INPUT = Path("/path/to/darktable/export")
# Optional: where run folders are created (defaults to current working directory).
OUTPUT_BASE = Path.home() / "pipeline_output"
def main() -> None:
with Pipeline(
name="example_grayscale",
input_dir=INPUT,
output_base=OUTPUT_BASE,
) as p:
p.step("imagemagick_grayscale", inputs="input")
# Chain another step on the result:
# gray = p.step("imagemagick_grayscale", inputs="input")
# p.step("imagemagick_grayscale", inputs=gray, colorspace="Gray")
output_root = p.run()
print(f"Pipeline finished. Output: {output_root}")
if __name__ == "__main__":
main()