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>
This commit is contained in:
@@ -18,8 +18,9 @@ def main() -> None:
|
||||
input_dir=INPUT,
|
||||
output_base=OUTPUT_BASE,
|
||||
) as p:
|
||||
gray = p.step("imagemagick_grayscale", inputs="input")
|
||||
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()
|
||||
|
||||
|
||||
@@ -37,8 +37,7 @@ GMIC_CRAYONGRAFFITI = "-fx_crayongraffiti2 300,50,1,0.4,12,1,2,2,0"
|
||||
GMIC_ANAGLYPH = "-fx_stereo_to_anaglyph 2,0"
|
||||
GMIC_DROP_SHADOW = "-fx_drop_shadow3d 0,0,0,10,1,1,2,0.5,194,37,24,200,0"
|
||||
GMIC_BOKEH = (
|
||||
f"-fx_bokeh 3,5,0,30,8,4,0.3,0.2,36,74,137,{ALPHA1},0.7,30,20,20,1,2,"
|
||||
f"194,37,24,{ALPHA2},0.15"
|
||||
f"-fx_bokeh 3,5,0,30,8,4,0.3,0.2,36,74,137,{ALPHA1},0.7,30,20,20,1,2,194,37,24,{ALPHA2},0.15"
|
||||
)
|
||||
|
||||
|
||||
@@ -71,9 +70,7 @@ def main() -> None:
|
||||
)
|
||||
|
||||
# recipe: gmic-edges-rembg
|
||||
rembg_edges = p.step(
|
||||
"gmic", inputs=rembg_out, command=GMIC_EDGES, step_id="rembg_edges"
|
||||
)
|
||||
rembg_edges = p.step("gmic", inputs=rembg_out, command=GMIC_EDGES, step_id="rembg_edges")
|
||||
composite_edges = p.step(
|
||||
"composite", inputs=[rembg_edges, rembg_out], step_id="composite_edges"
|
||||
)
|
||||
@@ -92,9 +89,7 @@ def main() -> None:
|
||||
)
|
||||
|
||||
# recipe: gmic-neon-rembg
|
||||
rembg_neon = p.step(
|
||||
"gmic", inputs=rembg_out, command=GMIC_NEON, step_id="rembg_neon"
|
||||
)
|
||||
rembg_neon = p.step("gmic", inputs=rembg_out, command=GMIC_NEON, step_id="rembg_neon")
|
||||
composite_neon = p.step(
|
||||
"composite", inputs=[rembg_neon, rembg_out], step_id="composite_neon"
|
||||
)
|
||||
@@ -248,15 +243,11 @@ def main() -> None:
|
||||
input_bokeh = p.step(
|
||||
"gmic", inputs=input_tone_map, command=GMIC_BOKEH, step_id="input_bokeh"
|
||||
)
|
||||
bokeh_mid = p.step(
|
||||
"composite", inputs=[input_tone_map, input_bokeh], step_id="bokeh_mid"
|
||||
)
|
||||
bokeh_mid = p.step("composite", inputs=[input_tone_map, input_bokeh], step_id="bokeh_mid")
|
||||
p.step("composite", inputs=[bokeh_mid, rembg_out], step_id="composite_bokeh")
|
||||
|
||||
# recipe: color-bg-drop-shadow-rembg
|
||||
color_bg = p.step(
|
||||
"imagemagick_fill", inputs="input", color1=COLOR1, step_id="color_bg"
|
||||
)
|
||||
color_bg = p.step("imagemagick_fill", inputs="input", color1=COLOR1, step_id="color_bg")
|
||||
rembg_shadow = p.step(
|
||||
"gmic", inputs=rembg_out, command=GMIC_DROP_SHADOW, step_id="rembg_shadow"
|
||||
)
|
||||
|
||||
@@ -40,14 +40,10 @@ def main() -> None:
|
||||
gmic_shadow = p.step("gmic", inputs=rembg, command=GMIC_DROP_SHADOW)
|
||||
gmic_smooth = p.step("gmic", inputs=rembg, command=GMIC_JPR_SMOOTH)
|
||||
|
||||
gmic_stereo_alpha = p.step(
|
||||
"color_to_alpha", inputs=gmic_stereo, color="#000000"
|
||||
)
|
||||
gmic_stereo_alpha = p.step("color_to_alpha", inputs=gmic_stereo, color="#000000")
|
||||
yellow_bg = p.step("imagemagick_fill", inputs="input", color1=YELLOW)
|
||||
|
||||
gmic_smooth_alpha = p.step(
|
||||
"color_to_alpha", inputs=gmic_smooth, color="#7f7f7f"
|
||||
)
|
||||
gmic_smooth_alpha = p.step("color_to_alpha", inputs=gmic_smooth, color="#7f7f7f")
|
||||
gmic_smooth_sized = p.step(
|
||||
"imagemagick_scale_crop",
|
||||
inputs=gmic_smooth_alpha,
|
||||
|
||||
@@ -6,7 +6,9 @@ from pathlib import Path
|
||||
from imagepipeline import Pipeline
|
||||
|
||||
# Darktable export folder.
|
||||
INPUT = Path("/home/frank/pics/20260517_Albershausen Crusaders - Biberach Beavers/darktable_exported/png")
|
||||
INPUT = Path(
|
||||
"/home/frank/pics/20260517_Albershausen Crusaders - Biberach Beavers/darktable_exported/png"
|
||||
)
|
||||
|
||||
# Where timestamped run folders are created.
|
||||
OUTPUT_BASE = Path.home() / "pipeline_output"
|
||||
|
||||
@@ -5,7 +5,9 @@ from pathlib import Path
|
||||
|
||||
from imagepipeline import Pipeline
|
||||
|
||||
INPUT = Path("/home/frank/pics/20260620_Albershausen Crusaders - Montabaur Fighting Farmers/darktable_exported")
|
||||
INPUT = Path(
|
||||
"/home/frank/pics/20260620_Albershausen Crusaders - Montabaur Fighting Farmers/darktable_exported"
|
||||
)
|
||||
OUTPUT_BASE = Path.home() / "pipeline_output"
|
||||
|
||||
# Reuse outputs from a previous run or external folder (key = step id, e.g. rembg_01).
|
||||
@@ -80,13 +82,9 @@ def main() -> None:
|
||||
scale=1.05,
|
||||
)
|
||||
|
||||
rembg_stereo_alpha = p.step(
|
||||
"color_to_alpha", inputs=rembg_stereo, color="#000000"
|
||||
)
|
||||
rembg_stereo_alpha = p.step("color_to_alpha", inputs=rembg_stereo, color="#000000")
|
||||
color_bg = p.step("imagemagick_fill", inputs="input", color1=COLOR1)
|
||||
rembg_smooth_alpha = p.step(
|
||||
"color_to_alpha", inputs=rembg_jpr_smooth, color="#7f7f7f"
|
||||
)
|
||||
rembg_smooth_alpha = p.step("color_to_alpha", inputs=rembg_jpr_smooth, color="#7f7f7f")
|
||||
rembg_smooth_sized = p.step(
|
||||
"imagemagick_scale_crop",
|
||||
inputs=rembg_smooth_alpha,
|
||||
|
||||
@@ -35,6 +35,7 @@ GMIC_GRADIENT_B = (
|
||||
"255,255,128,128,128,255,255,0,255,255,0,0,0,0"
|
||||
)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
with Pipeline(
|
||||
name="orange",
|
||||
|
||||
@@ -22,8 +22,7 @@ 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"
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
@@ -59,9 +58,7 @@ def main() -> None:
|
||||
scale=1.05,
|
||||
step_id="rembg_jpr_smooth_sized",
|
||||
)
|
||||
input_bokeh = p.step(
|
||||
"gmic", inputs="input", command=GMIC_BOKEH, step_id="input_bokeh"
|
||||
)
|
||||
input_bokeh = p.step("gmic", inputs="input", command=GMIC_BOKEH, step_id="input_bokeh")
|
||||
|
||||
# recipe: colorsplash
|
||||
composite_colorsplash = p.step(
|
||||
@@ -74,9 +71,7 @@ def main() -> None:
|
||||
)
|
||||
|
||||
# recipe: original-drop-shadow-rembg
|
||||
shadow_mid = p.step(
|
||||
"composite", inputs=["input", rembg_shadow], step_id="shadow_mid"
|
||||
)
|
||||
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"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user