How to set a header image?

get_header_image() uses get_theme_mod() to get the saved header image, so I would assume the following example should be used to update the saved value. And set_header_image does the same thing at the end of it, after all the different checks.

set_theme_mod( 'header_image' , 'your-image-url-here' );