Render node author profile image in node template
If you like to do this in ui with one line of code:

1) add a view mode for user and name it "nodeview":


  /admin/structure/display-modes/view/add/user


2) activate the new view mode "nodeview" at the bottom of this page in "Custom Display Settings", then you get a new tab for the view mode "nodeview". Configure which fields are displayed and how they are formatted:


  /admin/config/people/accounts/display


3) Use the new view mode to render the author of the node in node preprocess:

$variables['author'] = \Drupal::entityTypeManager()-&gt;getViewBuilder('user')-&gt;view($variables['node']-&gt;getOwner(), 'nodeview');


4) Put the variable in twig

{{ author }}


This method allows full customization in ui and it is fast, because the rendered author gets cached and will be reused in every node referenced.