On this page
Iso seam checker: a Python port of the TypeScript checkIsoSeams that finds color mismatches across diamond tile edges, conformance-tested for parity.
#server.src.pixelweaver.iso_seams
#server.src.pixelweaver.iso_seams
Iso seam checking -- Python port of src/lib/iso/seam-checker.ts checkIsoSeams.
Shared by the check_iso_seams MCP tool. A conformance test asserts this implementation and the TypeScript one produce identical issue lists on shared fixtures, so the iteration order and hex formatting here MUST match the TS version exactly (row-major scan; direction order N/E/S/W as [(1,0),(-1,0), (0,1),(0,-1)]; positive-y neighbor offsets [SE, SW]).
#is_inside_diamond
def is_inside_diamond(px: int, py: int, ox: int, oy: int, w: int, h: int) -> boolWhether pixel (px, py) is inside the diamond with top-left (ox, oy).
Mirrors iso-lattice.ts isInsideDiamond, using the pixel center.
#_hex
def _hex(r: int, g: int, b: int, a: int) -> strFormat RGBA as '#RRGGBBAA' uppercase, matching TS rgbaToHex.
#check_iso_seams
def check_iso_seams(rgba_bytes: bytes, width: int, height: int, tile_w: int, tile_h: int) -> list[dict[str, Any]]Return the iso seam mismatches of a composited RGBA buffer.
Hard preconditions (ValueError, no silent fallback): width == tile_w and height >= tile_h. The diamond band is anchored bottom-center at (0, height - tile_h). Fully-transparent pixels compare equal regardless of RGB.