color-thief icon indicating copy to clipboard operation
color-thief copied to clipboard

How do you determine the threshold like 125 for alpha and 250 for rgb

Open wenmin-wu opened this issue 6 years ago • 2 comments

Dear lokesh, I encountered a problem when the alpha of the image are all below 125 such as the following image. test I want to know can lower the alpha threshold to 100 ? thx!

wenmin-wu avatar May 31 '18 09:05 wenmin-wu

Fork and implement a patch of your own at #L122-L127

AlfredJKwack avatar Dec 02 '18 13:12 AlfredJKwack

I also have same question. It doesn't make sense to filter with the following logic:

        // If pixel is mostly opaque and not white
        if (typeof a === 'undefined' || a >= 125) {
            if (!(r > 250 && g > 250 && b > 250)) {
                pixelArray.push([r, g, b]);
            }
        }

why r, g, b must less than 250? and alpha must bigger than 125?

tonyqus avatar Mar 31 '21 07:03 tonyqus