StackBlur
StackBlur copied to clipboard
Black borders around my canvas
Hi,
I'm trying your lib with pixijs but I'm encountering a problem when I try to apply the blur.
This is an example which show the problem :

Thanks,
Hello,
I cannot reproduce this bug by myself... Can you provide the original image and a minimal code to reproduce it?
It could be happening if you call canvasRGB/canvasRGBA with a rect that goes outside the canvas. I was needing to use floats as the arguments for the function (but that caused a bug @flozz) so I used Math.ceil to fix that issue, but it created a black border. I changed it to Math.floor and it worked fine. Hope this helps @ThomasAtome.
@flozz to elaborate on that bug I mentioned, passing floats to the function caused a large black rectangle (with hard edges) to appear on the canvas.
Oh lmao, this thing is far from designed for floats. You are not supposed to put them into the radius, nor into the coordinates.
We also saw black bars because rect values used floats. One patch is to use Math.floor on rect values in the RGB and RGBA functions as @iONinja suggested. We use the original version of StackBlur, but will submit a patch once we can drop support and adopt this more modern version.