31 lines
823 B
Python
31 lines
823 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:
|
|
gray = p.step("imagemagick_grayscale", inputs="input")
|
|
# Chain another step on the result:
|
|
# p.step("imagemagick_grayscale", inputs=gray, colorspace="Gray")
|
|
output_root = p.run()
|
|
|
|
print(f"Pipeline finished. Output: {output_root}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|