public function toString($type = 'jpg', $quality = 75)
        {
            ob_start();

            if($type == 'jpg' && (imagetypes() & IMG_JPG))
                imagejpeg($this->im, null, $quality);
            elseif($type == 'png' && (imagetypes() & IMG_PNG))
                imagepng($this->im);
            elseif($type == 'gif' && (imagetypes() & IMG_GIF))
                imagegif($this->im);

            return ob_get_clean();
        }