← back to Wallco Ai
tools: add scripts/seam_check.py — quantify pattern seamlessness
7901449c1db091d925c7ed8bc8c3a27fc1083eea · 2026-05-12 14:56:42 -0700 · SteveStudio2
Tiles a 1024×1024 pattern PNG into a 2×2 grid and computes the mean
per-channel pixel delta between leftmost↔rightmost columns and
top↔bottom rows. Δ < 15 (on a 0-255 scale) = visually seamless.
Surfaced today against design #14 (Sapphire Floret, vanilla
SDXL output): h-Δ 65.66, v-Δ 37.74 — visibly non-seamless raw, even
though the upstream room renderer hides the seam in the wall composite.
This is the empirical evidence behind the debate-team recommendation
to swap GEN_BACKEND from vanilla SDXL to a tiling-aware variant.
Usage:
python3 scripts/seam_check.py <pattern.png> [output_2x2.png]
Files touched
Diff
commit 7901449c1db091d925c7ed8bc8c3a27fc1083eea
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date: Tue May 12 14:56:42 2026 -0700
tools: add scripts/seam_check.py — quantify pattern seamlessness
Tiles a 1024×1024 pattern PNG into a 2×2 grid and computes the mean
per-channel pixel delta between leftmost↔rightmost columns and
top↔bottom rows. Δ < 15 (on a 0-255 scale) = visually seamless.
Surfaced today against design #14 (Sapphire Floret, vanilla
SDXL output): h-Δ 65.66, v-Δ 37.74 — visibly non-seamless raw, even
though the upstream room renderer hides the seam in the wall composite.
This is the empirical evidence behind the debate-team recommendation
to swap GEN_BACKEND from vanilla SDXL to a tiling-aware variant.
Usage:
python3 scripts/seam_check.py <pattern.png> [output_2x2.png]
---
scripts/seam_check.py | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/scripts/seam_check.py b/scripts/seam_check.py
new file mode 100755
index 0000000..68224e8
--- /dev/null
+++ b/scripts/seam_check.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+"""Tile a pattern 2×2 and compute edge-pixel mean Δ to quantify seamlessness."""
+from PIL import Image
+import sys, pathlib
+
+if len(sys.argv) < 2:
+ print("usage: seam_check.py <pattern.png> [output_2x2.png]", file=sys.stderr); sys.exit(2)
+src = pathlib.Path(sys.argv[1])
+out = pathlib.Path(sys.argv[2]) if len(sys.argv) > 2 else src.with_name(src.stem + '_2x2.png')
+
+im = Image.open(src).convert('RGB')
+w, h = im.size
+tile = Image.new('RGB', (w*2, h*2))
+for x in range(2):
+ for y in range(2):
+ tile.paste(im, (x*w, y*h))
+tile.save(out, optimize=True)
+
+# Quantify seams: mean per-channel pixel delta between leftmost and rightmost
+# columns (horizontal seam test) and between top and bottom rows (vertical).
+px = im.load()
+def mean_delta(get_a, get_b, n):
+ s = 0
+ for i in range(n):
+ a = get_a(i); b = get_b(i)
+ s += abs(a[0]-b[0]) + abs(a[1]-b[1]) + abs(a[2]-b[2])
+ return s / (n * 3)
+
+h_delta = mean_delta(lambda y: px[0, y], lambda y: px[w-1, y], h)
+v_delta = mean_delta(lambda x: px[x, 0], lambda x: px[x, h-1], w)
+# A seamless pattern would have very low delta. Δ < ~10 on 0-255 scale = visually seamless.
+print(f"size: {w}×{h}")
+print(f"left↔right edge mean Δ: {h_delta:.2f} ({'seamless' if h_delta < 15 else 'seam visible'})")
+print(f"top↔bottom edge mean Δ: {v_delta:.2f} ({'seamless' if v_delta < 15 else 'seam visible'})")
+print(f"2x2 preview → {out}")
← dbc500b fix(/api/room): retry upstream once on fetch failed / transi
·
back to Wallco Ai
·
studio: post-process every generated pattern to be truly sea 61dcaab →