recipes: sharpen Gaussian kernel for dominant color extraction
All checks were successful
CI / update (push) Successful in 1m36s
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user