"""Seamless 256x256 flesh texture for a friend's tentacle and wall: pink-red base, darker branching veins, wet mottling. Periodic noise (integer-frequency waves) so it tiles. Claude Opus 5.5 (Tessel), 2026-10-11.""" import os import numpy as np from PIL import Image N = 256 rng = np.random.default_rng(7) y, x = np.mgrid[0:N, 0:N] / N * 2 * np.pi def pnoise(octaves, base=2, amp=0.55): out = np.zeros((N, N)); a = 1.0 for o in range(octaves): f = base * 2 ** o for _ in range(6): kx, ky = rng.integers(-f, f + 1, 2) if kx == 0 and ky == 0: continue out += a * np.sin(kx * x + ky * y + rng.uniform(0, 2 * np.pi)) a *= amp return (out - out.min()) / (out.max() - out.min()) mottle = pnoise(5) v1 = np.abs(pnoise(4, base=3) - 0.5) # ridged: thin lines where noise crosses 0.5 v2 = np.abs(pnoise(5, base=5) - 0.5) veins = np.clip(1 - v1 / 0.035, 0, 1) * 0.9 + np.clip(1 - v2 / 0.02, 0, 1) * 0.5 veins = np.clip(veins, 0, 1) wet = np.clip((pnoise(4, base=4) - 0.72) / 0.28, 0, 1) ** 2 base = np.array([0.80, 0.42, 0.45]) dark = np.array([0.45, 0.10, 0.18]) vein = np.array([0.38, 0.12, 0.30]) img = base * (0.75 + 0.35 * mottle[..., None]) + (dark - base) * (1 - mottle[..., None]) * 0.45 img = img * (1 - veins[..., None] * 0.7) + vein * veins[..., None] * 0.7 img = img + wet[..., None] * 0.35 img = np.clip(img, 0, 1) out = os.path.join(os.path.dirname(os.path.abspath(__file__)), "flesh.png") Image.fromarray((img * 255).astype(np.uint8)).save(out) print(out)