A simple trick to separate the Cast shadows from Form shadows in compositor.

Imagine we want to change (eg blur) the shadow of a Blender rendering.
We will activate the Shadow Pass in rendering layer and then  (after having blurred), he mixes in compositor.
We realize at this point that in the shadow pass are both Cast Shadows and Form Shadows.
so the blur filter acts on both creating a halo around the object.
Now a little trick to separate Cast Shadows  from Form Shadows.
Activate the Diffuse pass and Specular pass.
Add the specular on diffuse
Mix the result with the combined image in difference mode.
You will have an inverted representation of the Cast Shadows.

Invert, correct the brightness with a color ramp.
Finally, Blurred or change your shadows as you like before composition.

Fernando Luceri