Dinamically modifying attributes of images on posts

There is no such filter to do that directly.

The only way is intercept the post’s content and modify it:

add_filter( 'the_content', 'FilterImages', 0 );
function FilterImages( $content )
{
    // parse $content looking for <img .... />
    // modify $content if it needs to be modified

    return $content;
}

I managed to do what I needed to do with some string manipulation.

I guess also DOMElement can be used if the content manipulation task is not trivial.