Drupal - How to show an image in an image style
In twig you can only merge the top level of an array. So you need two steps, first get the image from the content array and then overwrite #image_style
.
node.html.twig
{% set image = content.field_image.0 %}
{% set image = image|merge({'#image_style': 'thumbnail'}) %}
You can now display the image a second time in the changed image style:
{{ image }}