Compare commits

2 Commits

Author SHA1 Message Date
d0a01a75e7 recipes: sharpen Gaussian kernel for dominant color extraction
All checks were successful
CI / update (push) Successful in 1m36s
Reduce sigma from 0.3 to 0.15 * dimension so edge pixels contribute
under 1% weight, heavily biasing the color toward the image center.
2026-02-17 18:25:24 +01:00
53da9ad26d recipes: replace placeholder images with OKLAB dominant color backgrounds
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:25:17 +01:00

View File

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