"""Skin and fin textures for the Moonwater mudskipper, made from noise and dots (hear-venv: numpy + PIL). Sphere UVs: u runs around the sphere's Z axis, v from bottom pole (0) to top (1). On a flattened-sphere fin whose base pole sits in the body, constant-u lines run out from the base like fin rays, so rays are vertical stripes here. Claude Opus 5.5 (Tessel), 2026-10-15.""" import os import numpy as np from PIL import Image HERE = os.path.dirname(os.path.abspath(__file__)) rng = np.random.default_rng(15) N = 256 def blur_noise(n, octaves=4, seed=0): r = np.random.default_rng(seed) out = np.zeros((n, n)) for o in range(octaves): k = 4 * 2 ** o g = Image.fromarray((r.random((k, k)) * 255).astype(np.uint8)).resize((n, n), Image.BICUBIC) out += np.asarray(g, float) / 255 / (2 ** o) out -= out.min() return out / out.max() def dots(img, count, rad, col, alpha=1.0, seed=1, vrange=(0.0, 1.0)): r = np.random.default_rng(seed) yy, xx = np.mgrid[0:N, 0:N] for _ in range(count): cx, cy = r.random() * N, N * (1 - (vrange[0] + r.random() * (vrange[1] - vrange[0]))) rr = rad * (0.6 + 0.8 * r.random()) dx = np.minimum(np.abs(xx - cx), N - np.abs(xx - cx)) # wrap round u d = np.sqrt(dx ** 2 + (yy - cy) ** 2) m = np.clip(1 - (d - rr) / 1.2, 0, 1)[..., None] * alpha img[..., :3] = img[..., :3] * (1 - m) + np.array(col) * m return img # skin: olive mud with darker blotches, pale belly toward the bottom pole, bright blue specks on the upper half n = blur_noise(N, seed=3) base = np.array([0.47, 0.44, 0.31]) dark = np.array([0.26, 0.24, 0.17]) belly = np.array([0.66, 0.63, 0.52]) v = np.linspace(1, 0, N)[:, None, None] # image row 0 = top of sphere (v=1) skin = base * (1 - n[..., None] * 0.9) + dark * (n[..., None] * 0.9) bw = np.clip((0.3 - v) / 0.15, 0, 1) # bottom 30% fades to belly skin = skin * (1 - bw) + belly * bw skin = np.concatenate([skin, np.ones((N, N, 1))], axis=2) skin = dots(skin, 55, 1.3, [0.28, 0.80, 1.0], seed=4, vrange=(0.35, 0.95)) skin = dots(skin, 35, 1.2, [0.85, 0.88, 0.80], alpha=0.8, seed=5, vrange=(0.3, 0.9)) skin = dots(skin, 40, 2.6, [0.20, 0.18, 0.13], alpha=0.6, seed=6, vrange=(0.3, 1.0)) Image.fromarray((np.clip(skin, 0, 1) * 255).astype(np.uint8), "RGBA").convert("RGB").save( os.path.join(HERE, "skin.png")) # fin: translucent blue-grey membrane, dark rays (vertical stripes), a blue band and dark spots near the edge u = np.linspace(0, 1, N)[None, :] fin = np.zeros((N, N, 4)) mem = np.array([0.42, 0.48, 0.55]) fin[..., :3] = mem fin[..., 3] = 0.55 rays = (np.abs(((u * 24) % 1) - 0.5) < 0.09).astype(float) rays = np.broadcast_to(rays, (N, N)) fin[..., :3] = fin[..., :3] * (1 - rays[..., None] * 0.6) + np.array([0.18, 0.2, 0.24]) * rays[..., None] * 0.6 fin[..., 3] = np.maximum(fin[..., 3], rays * 0.85) vv = np.broadcast_to(v[..., 0], (N, N)) edge = np.exp(-((vv - 0.86) / 0.05) ** 2) # band near the rim of the upper half fin[..., :3] = fin[..., :3] * (1 - edge[..., None] * 0.8) + np.array([0.25, 0.65, 0.95]) * edge[..., None] * 0.8 fin[..., 3] = np.maximum(fin[..., 3], edge * 0.8) fin = dots(fin, 30, 1.8, [0.12, 0.12, 0.14], alpha=0.7, seed=7, vrange=(0.55, 0.8)) fin[..., 3] = np.where(vv > 0.97, fin[..., 3] * 0.5, fin[..., 3]) Image.fromarray((np.clip(fin, 0, 1) * 255).astype(np.uint8), "RGBA").save(os.path.join(HERE, "fin.png")) print("wrote skin.png fin.png")