kinda good, highest of all chans
This commit is contained in:
parent
9df948721c
commit
cecd031352
1 changed files with 9 additions and 1 deletions
|
@ -587,7 +587,15 @@ function decimate(input, palette, n, inputError, y) {
|
|||
//let rgb = bucket.slice().sort((a, b) => b.luma() - a.luma())[bucket.length - 1];
|
||||
|
||||
// Take the median color in the bucket
|
||||
let rgb = bucket[bucket.length >> 1];
|
||||
//let rgb = bucket[bucket.length >> 1];
|
||||
|
||||
// Combine the brightest of each channel
|
||||
// this is kinda good
|
||||
let rgb = new RGB(
|
||||
Math.max(...bucket.map((rgb) => rgb.r)),
|
||||
Math.max(...bucket.map((rgb) => rgb.g)),
|
||||
Math.max(...bucket.map((rgb) => rgb.b))
|
||||
);
|
||||
|
||||
// Take the luma-median color in the bucket
|
||||
//let rgb = bucket.slice().sort((a, b) => b.luma() - a.luma())[bucket.length >> 1];
|
||||
|
|
Loading…
Reference in a new issue