public function render()
    {
        $image = null;

        if ($this->resource) {
            ob_start();
            $this->outputBufferByImage(null, $this->quality);
            $string = ob_get_contents();
            ob_end_clean();

            if (!empty($string)) {
                $image = imagecreatefromstring($string);
            }
        }

        return $image;
    }