How to print alt or title field image in custom block programmatically? I want to print alt or title field image file in custom module Drupal 8. I load file entity use Drupal\file\Entity\File; I checked core/modules/file/src/Entity/File.phpall public function but not get any function which return title or alt text. 

$graph_data = Paragraph::load($graph['target_id']);
$output .= '&lt;div class="swiper-slide"&gt;';
$output .= '&lt;div class="slide-inner"&gt;';
foreach ($graph_data-&gt;field_slider_image as $item) {
 $title_img =    "Need image title here";
if ($item-&gt;entity) {
$slide_uri = $item-&gt;entity-&gt;getFileUri();
$url = ImageStyle::load('orignal')-&gt;buildUrl($slide_uri);
$output .= '&lt;div class="col-md-6"&gt;&lt;img src="'.$url.'" class="img-responsive"&gt;&lt;h2&gt;'.$title_img.'&lt;/h2&gt;&lt;/div&gt;';  
}
}


Please anyone give idea ?

Thankyou
You can load the node and then fetch the paragraph targetid . Later you can load paragraph targetid and then get all attributes of the image.

use Drupal\paragraphs\Entity\Paragraph; 
use Drupal\node\Entity\Node;

$node = Node::load($nid);
$paragraph_field = $node-&gt;get("field_paragraph")-&gt;getValue();
$paragraph = Paragraph::load($paragraph_field[0]['target_id']);
$image_alt = $paragraph-&gt;my_image_field-&gt;alt;
$image_title= $paragraph-&gt;my_image_field-&gt;title;