refactor(xcf_stack): use explicit inputs for layer list and scheduling

Replace prior_steps and runs_last with inputs=[...] step refs so GIMP
export waits only on listed layers. Add rezepttest pipeline and
bokeh-oktagon recipe.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Frank Schwenk
2026-07-12 12:51:35 +02:00
parent cbca473f06
commit 0daf3e2315
7 changed files with 177 additions and 55 deletions
+101
View File
@@ -0,0 +1,101 @@
#!/usr/bin/env python3
"""Rezepttest pipeline — RECIPES.md smoke test (Indians Aichelberg logo colors)."""
from pathlib import Path
from imagepipeline import Pipeline
# Change to your Darktable export folder.
INPUT = Path("/home/frank/tmp/bar")
OUTPUT_BASE = Path.home() / "pipeline_output"
EXISTING_OUTPUTS: dict[str, Path] = {}
CONTINUE_FROM: Path | None = None
# Colors from Indians Aichelberg logo (orange text + red stitching).
COLOR1 = "#f0b020" # 240, 176, 32
COLOR2 = "#f01000" # 240, 16, 0
ALPHA1 = 160
ALPHA2 = 110
GMIC_DROP_SHADOW = "-fx_drop_shadow3d 0,0,0,10,1,1,2,0.5,240,16,0,200,0"
GMIC_JPR_SMOOTH = "-jpr_gradient_smooth 0,1.5"
GMIC_BOKEH = (
f"-fx_bokeh 3,5,0,30,8,4,0.3,0.2,240,176,32,{ALPHA1},0.7,30,20,20,1,2,"
f"240,16,0,{ALPHA2},0.15"
)
def main() -> None:
with Pipeline(
name="rezepttest",
input_dir=INPUT,
output_base=OUTPUT_BASE,
existing_outputs=EXISTING_OUTPUTS or None,
continue_from=CONTINUE_FROM,
) as p:
rembg_out = p.step("rembg", inputs="input")
grayscale = p.step("gmic_grayscale", inputs="input")
gradient_radial_bg = p.step(
"imagemagick_fill",
inputs="input",
color1=COLOR1,
color2=COLOR2,
gradient=True,
radial=True,
)
rembg_shadow = p.step("gmic", inputs=rembg_out, command=GMIC_DROP_SHADOW)
rembg_jpr_smooth = p.step("gmic", inputs=rembg_out, command=GMIC_JPR_SMOOTH)
rembg_jpr_smooth_sized = p.step(
"imagemagick_scale_crop",
inputs=rembg_jpr_smooth,
scale=1.05,
)
input_bokeh = p.step("gmic", inputs="input", command=GMIC_BOKEH)
# recipe: colorsplash
composite_colorsplash = p.step("composite", inputs=[grayscale, rembg_out])
# recipe: rembg-radial-2colors (gradient-radial)
composite_radial = p.step("composite", inputs=[gradient_radial_bg, rembg_out])
# recipe: original-drop-shadow-rembg
shadow_mid = p.step("composite", inputs=["input", rembg_shadow])
composite_shadow = p.step("composite", inputs=[shadow_mid, rembg_out])
# recipe: original-jpr-smooth-rembg
smooth_mid = p.step("composite", inputs=["input", rembg_jpr_smooth_sized])
composite_smooth = p.step("composite", inputs=[smooth_mid, rembg_out])
# recipe: bokeh-oktagon
bokeh_mid = p.step("composite", inputs=["input", input_bokeh])
composite_bokeh = p.step("composite", inputs=[bokeh_mid, rembg_out])
# recipe: xcf-stack — explicit layer list, bottom to top
p.step(
"xcf_stack",
inputs=[
"input",
rembg_out,
grayscale,
gradient_radial_bg,
rembg_shadow,
rembg_jpr_smooth_sized,
input_bokeh,
composite_colorsplash,
composite_radial,
composite_shadow,
composite_smooth,
composite_bokeh,
],
)
output_root = p.run()
print(f"Pipeline finished. Output: {output_root}")
if __name__ == "__main__":
main()