StackBlur icon indicating copy to clipboard operation
StackBlur copied to clipboard

Black borders around my canvas

Open ThomasAtome opened this issue 8 years ago • 5 comments

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 :

sans titre

Thanks,

ThomasAtome avatar Apr 11 '17 15:04 ThomasAtome

Hello,

I cannot reproduce this bug by myself... Can you provide the original image and a minimal code to reproduce it?

flozz avatar Apr 12 '17 11:04 flozz

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.

iONinja avatar Jul 08 '18 02:07 iONinja

@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.

iONinja avatar Jul 08 '18 02:07 iONinja

Oh lmao, this thing is far from designed for floats. You are not supposed to put them into the radius, nor into the coordinates.

Artoria2e5 avatar Apr 04 '20 02:04 Artoria2e5

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.

panabee avatar Jul 21 '20 21:07 panabee