Add rel to all images in a post

something like this can be useful:

function image_tag($html, $id, $alt, $title) {
    return preg_replace(array(
            "https://wordpress.stackexchange.com/".str_replace('//','//',get_bloginfo('url')).'/i',
            '/s+width="d+"/i',
            '/s+height="d+"/i',
            '/alt=""/i'
        ),
        array(
            '',
            '',
            '',
            'alt="' . $title . '"'
        ),
        $html);
}
add_filter('get_image_tag', 'image_tag', 0, 4);