Nearest neighbor filter for tweening

Hi there, first post on here so apologies if this was already asked,
I noticed that when i was trying to tween a animation with a pixel lineart, that there’s no option for nearest neighbor interpolation on transform mask tweening.

maybe a nearest neighbor filter for transform masks could be implemented? it would definitely help tweens keep the linework quality nice and i could see a lot more people using the tween feature that way.

let me know if anyone has thoughts on this, Thanks!

I’ve deleted my previous reply because I made a foolish mistake that I’m to embarrassed to explain :woozy_face: Here is a new reply:

If you use the Transform Tool to create Animation Curve keyframes then the Filter setting in the Tool Options docker is stored in the transform mask data within the .kra file.

This does work for Nearest Neighbour.

Here is a ‘pixel art’ image that has been rotated using an Animation Curves transform with Filter set to Nearest Neighbour:

(Ignore the antialiasing on the red-black boundary, I didn’t bother correcting that mistake.)

However, this is what you get if you Render it out to an image sequence:

As you can see, there is smoothing filtering applied.

If you then Render to video, even with ‘neighbour’ filtering selected, you get the same result:

So, there does seem to be a problem in the Rendering stages which is quite strange since a rendered/exported static image does not have that filtering applied.
That may have been a deliberate decision to give a more ‘pleasing’ appearance to rendered videos.

@clownjev Can you examine your situation again to see if you agree with my observations?

2 Likes

I couldn’t find the nearest neighbor filter to add to the Animation curves transform, apologies as I’m not very familiar with working with filters in animation.
It does seem to add up with the problem I was having though.

I did find a partial workaround by adding a sharpen mask to help keep some of the lineart quality.



(with and without filter)
after rendering it to image sequence and video, it does also seem to apply that same smoothing filter, So it definitely seems like an issue with the Rendering.

1 Like

it might be related to this bug report ive submitted before: 459530 – Animated transform masks use low-quality bilinear interpolation when doing final rendering

this is dmitry’s explanation:

We have two ways of rendering the animation masks, one for quick on-the-fly rendering, and the other one is final high-quality render. Currently, animated transform masks can do high-quality rendering only for the “current frame” (and that high-quality render will use NN-settigns). But when rendering a transform mask into video file or cache, the mask will always use bilinear method. That is kind of “not implemented” kind of thing.

I would add my vote to this if I werent currently at my vote limit. Hopefully it gets fixed ^w^

2 Likes

was a solution found?