a60a18a253
Introduce ruff lint/format config, expand .gitignore, and reformat Python sources. Co-authored-by: Cursor <cursoragent@cursor.com>
119 lines
3.7 KiB
Python
119 lines
3.7 KiB
Python
#!/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,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", step_id="rembg_out")
|
|
grayscale = p.step("gmic_grayscale", inputs="input", step_id="grayscale")
|
|
gradient_radial_bg = p.step(
|
|
"imagemagick_fill",
|
|
inputs="input",
|
|
color1=COLOR1,
|
|
color2=COLOR2,
|
|
gradient=True,
|
|
radial=True,
|
|
step_id="gradient_radial_bg",
|
|
)
|
|
|
|
rembg_shadow = p.step(
|
|
"gmic", inputs=rembg_out, command=GMIC_DROP_SHADOW, step_id="rembg_shadow"
|
|
)
|
|
rembg_jpr_smooth = p.step(
|
|
"gmic", inputs=rembg_out, command=GMIC_JPR_SMOOTH, step_id="rembg_jpr_smooth"
|
|
)
|
|
rembg_jpr_smooth_sized = p.step(
|
|
"imagemagick_scale_crop",
|
|
inputs=rembg_jpr_smooth,
|
|
scale=1.05,
|
|
step_id="rembg_jpr_smooth_sized",
|
|
)
|
|
input_bokeh = p.step("gmic", inputs="input", command=GMIC_BOKEH, step_id="input_bokeh")
|
|
|
|
# recipe: colorsplash
|
|
composite_colorsplash = p.step(
|
|
"composite", inputs=[grayscale, rembg_out], step_id="composite_colorsplash"
|
|
)
|
|
|
|
# recipe: rembg-radial-2colors (gradient-radial)
|
|
composite_radial = p.step(
|
|
"composite", inputs=[gradient_radial_bg, rembg_out], step_id="composite_radial"
|
|
)
|
|
|
|
# recipe: original-drop-shadow-rembg
|
|
shadow_mid = p.step("composite", inputs=["input", rembg_shadow], step_id="shadow_mid")
|
|
composite_shadow = p.step(
|
|
"composite", inputs=[shadow_mid, rembg_out], step_id="composite_shadow"
|
|
)
|
|
|
|
# recipe: original-jpr-smooth-rembg
|
|
smooth_mid = p.step(
|
|
"composite", inputs=["input", rembg_jpr_smooth_sized], step_id="smooth_mid"
|
|
)
|
|
composite_smooth = p.step(
|
|
"composite", inputs=[smooth_mid, rembg_out], step_id="composite_smooth"
|
|
)
|
|
|
|
# recipe: bokeh-oktagon
|
|
bokeh_mid = p.step("composite", inputs=["input", input_bokeh], step_id="bokeh_mid")
|
|
composite_bokeh = p.step(
|
|
"composite", inputs=[bokeh_mid, rembg_out], step_id="composite_bokeh"
|
|
)
|
|
|
|
# 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()
|