title: convert gd resource type to stream image string context
body: <p>How can convert gd resource type to stream image string context (exactly reverse <a href="http://php.net/manual/en/function.imagecreatefromstring.php" rel="nofollow noreferrer">imagecreatefromstring</a> function)  </p>
  
  <p>I need the stream image string for convert it to the base64 by <a href="http://php.net/manual/en/function.base64_encode.php" rel="nofollow noreferrer">base64_encode</a> function.  </p>
  
  <p>Without use any external or temp file.</p>