Base64 is an encoding format that represents binary data. Google new feature instant previews are in text format, here Google requesting images(screenshots) are in string format to reduce server load time. In this post, I will show you how to make images to strings with PHP.
PHP images to strings
PHP terminology there is a function called base64_encode().
<?php
$img_src = "image/sample.png";
$imgbinary = fread(fopen($img_src, "r"), filesize($img_src));
$img_str = base64_encode($imgbinary);
echo '<img src="data:image/jpg;base64,'.$img_str.'" />';
?>



