public function render()
    {
        if (!is_resource($this->image)) {
            throw new \RuntimeException(
                'Attempt to render invalid resource as image.'
            );
        }

        header('Content-type: image/png');
        imagepng($this->image, null, 9, PNG_ALL_FILTERS);

        return $this;
    }
public function render()
    {
        if (!is_resource($this->image)) {
            throw new \RuntimeException(
                'Attempt to render invalid resource as image.'
            );
        }

        header('Content-type: image/png');
        imagepng($this->image, null, 9, PNG_ALL_FILTERS);

        return $this;
    }
public function render ( ) { if ( ! is_resource ( $ this -> image ) ) { throw new \ RuntimeException ( 'Attempt to render invalid resource as image.' ) ; } header ( 'Content-type: image/png' ) ; imagepng ( $ this -> image , null , 9 , PNG_ALL_FILTERS ) ; return $ this ; }
Outputs the image stream to the browser.

@return $this

@throws \RuntimeException Thrown if $this->image is not a valid image
resource.
Outputs the image stream to the browser .