Blend close shades of colors together in compositor I have some mesh that is intersecting with itself in some areas. To reduce the visibility of these intersections, I want to somehow blur, blend, flatten, or otherwise smooth out the area. This will probably need to be done in the compositor.

The picture shows a basic setup of two mesh pieces intersecting. The material is simple diffuse mixed with gloss based on fresnel. They have slight color variation due to the highlights and fresnel. You can see that in areas where one overlaps the other (yellow) the edge of the foreground piece is dark due to the fresnel, and stands out. I want to keep this.

In the red area, the meshes are intersecting but not near the edges. There is just enough color difference due to their shading for the intersection to be noticed (whereas a flat shaded material it wouldn't be.) I want to somehow change that area so that the intersection is less visible, but without losing detail in other areas, or losing the edge detail in the yellow area.

The bottom half of the image shows what I'm going for (done in photoshop with water droplet tool.)

EDIT: I am happy to use methods outside the compositor, such as mesh changes, etc, or even workflows that involve other programs. I just need to be able to automate it, and avoid having to hand paint/mask/edit things too much. I need a method that will work on a lot of pieces. They are animated in a simulation, so what areas are intersecting will change every frame.
I guess the following can be adjusted to your needs.

Two mesh objects, partly overlapping will be mirrored at intersections, RGB independant.



Compositing nodes create a mask of the intersections. (This part is highlighted in red.) 

Enable the Z and Object Index Pass of the render layer. (Properties Window > Scene > Passes)

Assign two different pass indices to the objects, in my case 1 and 2. (Properties Window > Object > Relations > Pass Index)

After dilating the objects masks, their overlapping part will the border between them. Multiply both masks to only retain the boundaries. If both parts are in the same mesh, you can get this mask with the Material Boundary of Freestyle (which will have correct anti-aliasing).

To exclude the parts, where the meshes overlap but are apart, check differences in the depth channel. The Prewitt or Sobel filter will give us the difference between close pixels. Where this z - difference is larger than a certain value (0.05 in my case) there is space between the objects (which we dont want to blur). Multiply the "edge" mask with Z-Difference lesser than the min value (0.05) to get the intersections.