markdaws / go-effects

Parallelized Image manipulation effects, written in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blur resizes picture unexpected

Klaus-Tockloth opened this issue · comments

I have a picture with 3000x3000 pixel. This operation ...

goeffects -effect=gaussian out.png out-gaussian-89-1.png 89 1

... resizes the new picture to 2912x2912 pixel.

How to avoid the resizing?

Hi - the code takes half the kernel size as a border around the image so that you are not trying to use pixels that fall outside the bounds of the image. Hence in your case the image is losing 2xborderWidth, where borderWidth is roughly kernelSize/2.

There is no way currently to avoid the resizing, you could update the code to maybe take an option that simply uses the edge pixel values to use outside the bounds of the image.

Thanks for looking into the issue. But I'm sorry ... with this very uncommon behavior goeffects is not really useful for me. You should document the behavior.