How to display blob image combined with imagettftext
<p>Still on imagettftext topic, now I have question how to display blob image on the page that created from imagecreatefrompng.
<a href="https://i.stack.imgur.com/Sm0wo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sm0wo.png" alt="I want to do this"></a></p>

<pre><code>&lt;?php
include('../db.php');

$id = $_GET['id'];

$sql = "SELECT * FROM data WHERE id=$id";
$result = $conn-&gt;query($sql);
$row = $result-&gt;fetch_array();

$id = $row['id']; //varchar
$name = $row['name']; //varchar
$address = $row['address']; //varchar
$photo = base64_encode($row['photo']); //blob image

$im = imagecreatefrompng('../img/idcard.png');
$black = imagecolorallocate($im, 0, 0, 0);
$font = "../fonts/Ubuntu-R.ttf";

imagettftext($im, 15, 0, 200, 175, $black, $font, $id);
imagettftext($im, 15, 0, 240, 200, $black, $font, $name);
imagettftext($im, 15, 0, 280, 275, $black, $font, $address);

imagettftext($im, 15, 0, 350, 315, $black, $font, $photo);

header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
?&gt;
</code></pre>

<p>My code display id card, text, but image/photo just display as text character</p>