You can use a few different methods depending on what php image library you have installed. Here's a few examples.
Note, the echo <img> is just a trick I use to display multiple images from the same php script when looping through a MySQL result resource. You could just as well output via header() as @NAVEED had shown.
GD:
$image = imagecreatefromstring($blob);
ob_start(); //You could also just output the $image via header() and bypass this buffer capture.
imagejpeg($image, null, 80);
$data = ob_get_contents();
ob_end_clean();
echo '<img src="data:image/jpg;base64,' . base64_encode($data) . '" />';
ImageMagick (iMagick):
$image = new Imagick();
$image->readimageblob($blob);
echo '<img src="data:image/png;base64,' . base64_encode($image->getimageblob()) . '" />';
GraphicsMagick (gMagick):
$image = new Gmagick();
$image->readimageblob($blob);
echo '<img src="data:image/png;base64,' . base64_encode($image->getimageblob()) . '" />';
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…