MCPcopy Index your code
hub / github.com/clips/pattern / brightpass

Function brightpass

pattern/canvas.js:3149–3155  ·  view source on GitHub ↗
(img, threshold)

Source from the content-addressed store, hash-verified

3147}
3148
3149function brightpass(img, threshold) {
3150 /* Returns a new image where pixels whose luminance fall below the threshold are black.
3151 */
3152 return filter(img, function(p) {
3153 return (Math.dot(p, LUMINANCE) > ((threshold || threshold == 0)? threshold : 0.5))? p : [0,0,0, p[3]];
3154 });
3155}
3156
3157function blur(img, radius) {
3158 /* Applies a stack blur filter to the image and returns the blurred image.

Callers 1

bloomFunction · 0.85

Calls 1

filterFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…