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.
This commit is contained in:
2026-02-17 18:25:20 +01:00
parent 53da9ad26d
commit d0a01a75e7

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.3 * width;
const sigmaY = 0.3 * height;
const sigmaX = 0.15 * width;
const sigmaY = 0.15 * height;
let wL = 0, wa = 0, wb = 0, wSum = 0;