What causes these artifacts around the edges of objects when using the defocus node? Continuing on with the same logo reveal. The depth of field in Blender results in this horrible effect around the edge. I've seen this sort of blurring a lot in games, Assassin's Creed is quite famous for it.

The focused object shouldn't make this strange outline and I need the edges to look properly blurred and transition nicely into whatever's behind it without this strange effect seen around the square in the top right.

Apologies for the low shading samples.





Just tried it in Cycles. The lighting looks a lot better as usual however the same effect is still happening. I've tried both 'radius' and 'f/stop'. Radius being the same and f/stop creating this crazy blur.

Radius



f/stop


The blurred cubes still have sharp edges alongside a blurry outline.
I've sometimes had odd results with the defocus node, particularly with large aperture sizes. See 2d vs 3d Depth of Field.

Try using built in Cycles DoF, which simulates the way light behaves at a lower level. It gives realistic and seamless results without requiring any fussing with the Z buffer:



The only downside is the inability to edit it in post.