final public function render($quality = 75)
    {
        header("Content-type: ".image_type_to_mime_type($this->type));

        switch ($this->type) {
            case \IMAGETYPE_GIF:
                imagegif($this->image, null);
            break;

            case \IMAGETYPE_JPEG:
                imagejpeg($this->image, null, $quality);
            break;

            case \IMAGETYPE_PNG:
                imagepng($this->image, null, 9);
            break;

            default:
                throw new LogicException(sprintf('Can not create image from "%s"', $this->file));
        }

        $this->done();
        exit(1);
    }