Display image without saving
<?php
$image = imagecreatefromjpeg( 'image.jpg' );
imagettftext( $image, 9, 0, 161, 72, -1, 'Arial.ttf', 'Some text' );
imagettftext( $image, 9, 0, 161, 105, -1, 'Arial.ttf', 'Some more text' );
header( "Content-Type: image/png" );
imagepng( $image );
imagedestroy( $image );
?> This code adds some text to an image and displays it in the browser without saving it.