itch.io is community of indie game creators and players

Devlogs

Every Texture is a Python Script

DEEP YELLOW
A browser game made in HTML5

Every Texture is a Python Script

Deep Yellow’s textures aren’t drawn. They’re not generated by an AI art model either. Every wall, floor, ceiling, and entity sprite in the game is a Python script that outputs a PNG.

Why?

I’m a solo dev with a generative art background, not a pixel artist. My art practice has always been about emergence from constraints — writing code that produces something you couldn’t have drawn by hand, on platforms that force economy (PICO-8, Tezos smart contracts, 128x128 pixel grids).

When Deep Yellow needed textures, the question wasn’t “what tool do I use to draw them?” It was “what process produces the right kind of ugly?”

The Backrooms aesthetic demands institutional decay — yellowed wallpaper with water stains, carpet that’s been walked on for decades, fluorescent light fixtures with that specific plastic grain. These aren’t pretty textures. They need to look like they were manufactured cheaply, installed decades ago, and left to rot in a place that shouldn’t exist.

The Pipeline

Every texture lives as a standalone Python script:

_claude_scripts/textures/backrooms_wallpaper/generate.py → output.png

The script uses PIL and NumPy. No neural networks, no diffusion models, no training data. The wallpaper texture, for example, builds up in layers:

  1. Base color — a flat greyish-yellow fill
  2. Noise layers — Gaussian noise at multiple scales for paper grain
  3. Geometric patterns — chevrons drawn with Bresenham’s line algorithm, vertical lines with slight waviness
  4. Aging effects — water stains (radial darkening with quadratic falloff), faded spots, vertical streaks
  5. Brightness equalization — prevents visible banding at tile boundaries
  6. Final grain pass — applied after equalization so it doesn’t get normalized out

Everything uses modulo wrapping so the texture tiles seamlessly. This is the hardest part — PIL’s built-in drawing functions clip at image boundaries, so every circle, line, and stain has to be drawn pixel by pixel with coordinate wrapping.

The Critic Cycle

Writing the script is only half the process. I use a structured creator/critic workflow where Claude Code orchestrates the whole thing:

  1. A creator agent writes or revises the Python script and runs it
  2. The output gets copied to a randomly-named temp file
  3. Two critic agents evaluate independently:
    • A comparison critic who knows what the texture should look like and checks it against the requirements
    • A blind critic who gets only the image — no filename, no description, no context — and describes what they see
  4. Their feedback gets synthesized into specific revision notes (“reduce saturation by 20%”, “fix tiling at left edge”)
  5. Back to step 1

The blind critic is the key insight. If someone who has no idea what the texture is supposed to be can still identify what it depicts and spots quality issues, the texture is doing its job. It typically takes 1-4 iterations to get a texture through this gauntlet.

Why Not Use an AI Art Generator?

Three reasons:

  1. Tileability. Image generators don’t produce seamlessly tileable textures reliably. Getting modulo-wrapped edges perfect requires mathematical precision, not vibes.

  2. Reproducibility. Every texture has a seed. I can regenerate any texture deterministically, tweak parameters, and get predictable results. If the wallpaper needs to be 10% more yellow next week, I change one number.

  3. It’s more fun. This is generative art. The constraint — “make it look like decaying institutional wallpaper using only math” — is the creative challenge. The output has a specific quality that comes from being procedural: slightly too regular, slightly too uniform, like it was manufactured rather than weathered naturally. For the Backrooms, that’s perfect.

The Skill

This workflow got reusable enough that I turned it into a Claude Code skill — a reusable prompt template that any Claude Code user could adapt for their own texture pipeline. The conductor (main Claude instance) never writes scripts or evaluates images itself. It only spawns agents and synthesizes feedback. That separation keeps the process honest.

All the texture scripts ship with the game’s source code. If you want to see how a Backrooms wallpaper gets made, it’s ~300 lines of Python and NumPy.

Download DEEP YELLOW
Leave a comment