How to add image field to paragraph programmatically? I am trying to programmatically add an image field value to a paragraph.

The field value of the image is as below

Array (
  [target_id] =&gt; 28
  [alt] =&gt; test images
  [title] =&gt;
  [width] =&gt; 1440
  [height] =&gt; 557
)


This is, how I try to set the image field value:

$paragraph-&gt;set('field_image',  $para_array);


The image field is not being set. Where am I going wrong and what will be the way to implement it?
You can treat the field like a PHP array to add (and not replace) an image:

use Drupal\paragraphs\Entity\Paragraph;

  $paragraph = Paragraph::load($paragraph_id);
  $paragraph-&gt;field_image[] = [
    'target_id' =&gt; $fid,
    'alt' =&gt; $alt,
    'title' =&gt; $title,
  ];
  $paragraph-&gt;save();