Plates — spec

Table of Contents

1. Purpose

Plates are the visual anchors for the sponsored-display banner format. Each _dir directory in the site (research, current, tools, events, _) gets a 1024×1024 master, cropped and derived into IAB-standard slot dimensions (Interactive Advertising Bureau 2017). The generation pipeline is Ollama flux2-klein locally (Mac), no cloud API — the pipeline lives on the creative side of the two-team architecture and its only output to the render side is the on-disk plate + manifest.

The plates are greyscale only. The diagrams and text on the site carry colour; the plates are the visual quiet. Chumbox-register prompts (see src/wal_sh/adtech/plates/prompts.cljc) push the generator into the "found photograph" corner of its distribution — smartphone flash, unstyled backgrounds, tight crops. The prompt is non-negotiable in style because dropping any of the three signature clauses (on-camera flash, cropped too tightly, unstyled clutter) returns a stock photo.

ORACLE: src/wal_sh/adtech/plates/gen.clj (bb-invoked generation), src/wal_sh/adtech/plates/prompts.cljc (prompt data).

2. Requirements

R1
Every _dir has a <dir>-master.png, 1024×1024.
R2
Every (dir, slot) pair has a <dir>-<slot>.png at IAB dimensions.
R3
Greyscale only. No colour output at any stage.
R4
Manifest carries model, prompt, sha256, width, height, alt, synthetic true.
R5
sha256 matches the file on disk. Verified at manifest build time.
R6
Derived plate ≤ per-slot :max-bytes cap.
R7
>1 unique colour after conversion (else deleted as degenerate — a solid-grey plate is a failed generation).
R8
Idempotent — masters are cached; --force-masters blows the cache. Slot derivations re-run cheaply from cached masters.
R9
Alt text describes the plate (what's in the image), not the article and never the headline. The plate is a decorative anchor, not editorial content — the alt reflects that.

3. Slot geometry

Masters (1024×1024) crop-then-derive into IAB slots via two curves:

Slot Output Crop from master Curve :max-bytes
leaderboard 728×90 1024×260 dither (posterize+o8x8) 80 K
billboard 970×250 1024×500 dither 250 K
mrec 300×250 1024×853 sigmoidal 60 K
mobile 320×50 1024×400 dither 30 K

Dither for anything under 128 px tall (1-bit is smaller and reads as deliberate); sigmoidal for mrec, tall enough to hold gray. Per-slot :max-bytes caps because dithered PNG doesn't compress like sigmoidal PNG.

4. Contract signature

Generation (gen.clj, invoked via bb):

(-main "--dirs" "research,current,tools,events,_"
       "--slots" "leaderboard,mrec,billboard,mobile"
       ["--force-masters"])
;; -> writes site/static/img/sponsored/*.png + manifest.json

Prompts (prompts.cljc, pure data):

style        ; string — the seven signature clauses
negative     ; string — negative clauses (no text, no logos, ...)
archetypes   ; {dir -> subject-clause}
(prompt-for dir)                                  ; -> composed prompt
iab-slots    ; {slot -> {:w :h :gen}}

Manifest shape:

{
  "generator": {"model": "flux2-klein", "version": "..."},
  "plates": [
    {"dir": "research", "slot": "leaderboard",
     "src": "/static/img/sponsored/research-leaderboard.png",
     "width": 728, "height": 90,
     "alt": "A worn clipboard on a kitchen counter...",
     "sha256": "0123abc...",
     "seed": 12345,
     "reproducible": true,
     "synthetic": true},
    ...
  ]
}

5. Invocation

bb -e "(require '[wal-sh.adtech.plates.gen :as g]) \
       (g/-main \"--dirs\" \"research,current,tools,events,_\" \
                \"--slots\" \"leaderboard,mrec,billboard,mobile\")"

bb -x parses args as a babashka.cli map and breaks the pipeline; prefer bb -e. --force-masters re-runs Ollama for all masters (otherwise cached).

Current output: 20 plates in site/static/img/sponsored/*.png (5 dirs × 4 slots) plus manifest.json. ~1.1 MB derived; masters are gitignored.

6. Prompt design

The style clause is seven verbatim strings joined by ", " — see src/wal_sh/adtech/plates/prompts.cljc. Dropping any clause is observed to make flux2-klein return a stock photo (styled lighting overrides the found-photograph subject). The three anchors are:

  1. On-camera flash
  2. Cropped too tightly
  3. Cluttered unstyled background

The negative clause lists 20 negative terms (no text, no letters, no logos, no clean minimal background). Two of these — no text and no letters — are the constraint that forces the plate to carry no copy; the sponsored-display format then puts every word on the banner as DOM text.

Archetype subjects are keyed by _dir:

  • research — clipboard with hand-ringed data row
  • current — before/after split-frame comparison
  • tools — POV shot of an unmarked tool
  • events — hand-drawn arrow overlay on a plain wall
  • _ — bird feeder against blown-out sky (fallback)

Comment header on each archetype in prompts.cljc is the archetype number (1..10 from the internal tone spec) so a future generation review can regenerate the weakest first.

7. Related literature

8. Cross-references

9. Open questions

  • Manifest schema v2. Per-plate sidecar JSON, thin index, rollback, A/B on plates. Captured in open work; the current v1 manifest is a single monolithic file.
  • Prompt-drift measurement. flux2-klein output drifts over model updates; a "did the prompt still render the intended archetype?" audit is not yet automated. The archetype table's comment header gives the manual review order.
  • Perceptual-hash-based dedup. Multiple generations for a single (dir, slot) pair with different seeds occasionally produce near-duplicates; a perceptual-hash filter (pHash / dHash) would drop them. Currently manual.
Ali, Muhammad, Piotr Sapiezynski, Miranda Bogen, Aleksandra Korolova, Alan Mislove, and Aaron Rieke. 2019. “Discrimination through Optimization: How Facebook’s Ad Delivery Can Lead to Biased Outcomes.” In Proceedings of the Acm on Human-Computer Interaction. Vol. 3. CSCW. https://doi.org/10.1145/3359301.
Association of National Advertisers. 2023. “Programmatic Media Supply Chain Transparency Study.” ANA. https://www.ana.net/miccontent/show/id/rr-2023-06-ana-programmatic-transparency-study.
———. 2024. “Made-for-Advertising (Mfa) Second Look and Update.” ANA. https://www.ana.net/miccontent/show/id/rr-2024-01-ana-mfa-second-look.
Cloudflare. n.d. “Rocket Loader.” https://developers.cloudflare.com/speed/optimization/content/rocket-loader/.
Interactive Advertising Bureau. 2017. “Iab New Standard Ad Unit Portfolio.” https://www.iab.com/newadportfolio/.
Zeng, Eric, Tadayoshi Kohno, and Franziska Roesner. 2020. “Bad News: Clickbait and Deceptive Ads on News and Misinformation Websites.” In Workshop on Technology and Consumer Protection (Conpro). https://badads.cs.washington.edu/.