Blur only part of render...

I want to use nodes to blur only part of the render. I have made use of the blur node, but I do not know how to setup my nodes so that I only blur the top and bottom part of my render (the middle part will be clear, no blur).

The blur must also be gradual from the bottom to middle.

My thoughts was to use the Color Ramp node to mask top and bottom, but I do not know how and what to connect to each other to achieve this effect.

Please help me!

Thanks in advance!!!

Render one blurred, and one normal, then combine them using a gradient mask. That would be one way. There may well be a better way though.

also the Blur node has a Variable size option and a size input
you can feed it with a mask or an image texture or a ramp as Modron says

Never do that. It doesn’t work. Period.

That’s the way to go.

Thanks guys!!! I kept on playing after posting this thread and came up with the solution.

Here it is:


The Defocus Node is just to get some DOF. The top and bottom blur is achieved with a Box Mask node and I then added a blur to this node to give the mask a gradient. There might be easier ways, but this method gives you a lot of control.

The result:


Thanks again and happy Blending!!!