Output image src via JSON
Something like the following could help you.

Just Set $filepath  and $filename with your desired values.

$filepath = "/path/to/my/image/chart.png";
$filename = "chart.png";

$response = new Response();
$disposition = $response-&gt;headers-&gt;makeDisposition(ResponseHeaderBag::DISPOSITION_INLINE, $filename);
$response-&gt;headers-&gt;set('Content-Disposition', $disposition);
$response-&gt;headers-&gt;set('Content-Type', 'image/png');
$response-&gt;setContent(file_get_contents($filepath));

return $response;