May 9, 2026

Procedural quotes

Experimenting with different image generation models to create background images for inspirational quotes.

I have a mostly non-AI system for generating procedural quote backgrounds set up for Rooster ‒ my daily newsletter side project. I spent some time today exploring if I could use image generation models for the same purpose. This is the pipeline I put together.

  1. Prompt generation The quote's mood (tone, energy, warmth, weight) is classified by Claude Haiku or OpenAI GPT 5.4 mini (tried out both), then mapped to an image generation prompt. The quote text itself is woven in as context so the background is thematically connected to what's being said.

  2. Background generation OpenAI, Gemini, or HuggingFace FLUX generates the raw image. These are composited under a paper texture using a multiply blend for an aged, tactile feel. I want it to feel realistic.

  3. Contrast-aware strip Instead of blindly washing the background with a flat overlay so the quote is visible, I sample the luminosity of just the text region (center band of the card). If contrast is insufficient, I apply a semi-transparent strip at a precisely calculated opacity. This hits the exact luminosity target in one shot. If the background already has enough contrast, no strip is used.

  4. Auto text color Once the strip is applied, I sample the same text region again and pick dark or light text based on the resulting luminosity. The sampling is intentionally narrow so a dark corner or bright edge elsewhere in the image doesn't skew the decision.

  5. Text rendering Satori renders the quote in Playfair Display as an SVG. Sharp composites it over the final background.

  6. Output The whole thing runs as a Next.js server action, returning a 600×315 PNG.

Overall, the results are a mixed bag and it isn't quite what I'm looking for yet. It was a fun exploration though. Cost is around 5 bucks so far.

Examples of quotes generated with pipeline.
Quote experiment examples

Examples of quotes generated with pipeline.