Compare commits

1 Commits

Author SHA1 Message Date
d65a418092 recipes: replace placeholder images with OKLAB dominant color backgrounds
Some checks failed
CI / update (push) Has been cancelled
Instead of generating/serving 20px placeholder images with blur CSS, extract
a perceptually accurate dominant color (Gaussian-weighted OKLAB average) and
use it as a solid background-color while the full image loads. Removes
placeholder image generation, blur CSS/JS, and placeholder directory references
across upload flows, API routes, service worker, and all card/hero components.
Adds admin bulk tool to backfill colors for existing recipes.
2026-02-17 18:24:25 +01:00

View File

@@ -56,8 +56,8 @@ export async function extractDominantColor(input: Buffer | string): Promise<stri
const { width, height } = info;
const cx = (width - 1) / 2;
const cy = (height - 1) / 2;
const sigmaX = 0.15 * width;
const sigmaY = 0.15 * height;
const sigmaX = 0.3 * width;
const sigmaY = 0.3 * height;
let wL = 0, wa = 0, wb = 0, wSum = 0;