meltingice / CamanJS

Javascript HTML5 (Ca)nvas (Man)ipulation

Home Page:http://camanjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sharpen filter adds transparancy lines

Andrej64 opened this issue · comments

When i use the sharpen filter on the canvas it adds on top and bottom a transparancy line.
Saving as png the lines are clearly visible.
Is this normal?

thanks.

i had the same issue and was able to solve it by changing a small thing in the Renderer.prototype.renderKernel - function

i switched out the Math.max and Math.min respectively on these 2 lines:

start = Math.max(start, this.c.dimensions.width * 4 * ((adjustSize - 1) / 2));
end = Math.min(end, n - (this.c.dimensions.width * 4 * ((adjustSize - 1) / 2)));

to:

start = Math.min(start, this.c.dimensions.width * 4 * ((adjustSize - 1) / 2));
end = Math.max(end, n - (this.c.dimensions.width * 4 * ((adjustSize - 1) / 2)));

I'm having the same issue. Depending on the level of sharpness, it renders a transparent line at just the bottom of the image or the top and bottom.

I tried the fix from Esc4pism - it worked to remove the transparent line at the top of the image but there's still a transparent line at the bottom.

I tried editing the level of sharpness but that did not change the issue.

Still looking for a solution.

Same here, when using the sharpness filter with a value greater than 0 gives some transparent block at the bottom of the result image. Please fix it.

I can't use the sharpen function, can anyone help me?
Each time I use this.sharpen(5), I get an error this.sharpen is not a function.
Thanks in advance.