Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Turn on output buffering
<?php ob_start(?callable $callback = null, int $chunk_size = 0, int $flags = PHP_OUTPUT_HANDLER_STDFLAGS): bool
<?php     protected function processJpeg()

    {

        ob_start();

        imagejpeg($this->image->getCore(), null, $this->quality);

        $this->image->mime = image_type_to_mime_type(IMAGETYPE_JPEG);

        $buffer = ob_get_contents();
<?php     protected function processPng()

    {

        ob_start();

        $resource = $this->image->getCore();

        imagealphablending($resource, false);

        imagesavealpha($resource, true);
<?php     protected function processGif()

    {

        ob_start();

        imagegif($this->image->getCore());

        $this->image->mime = image_type_to_mime_type(IMAGETYPE_GIF);

        $buffer = ob_get_contents();
<?php             );

        }



        ob_start();

        imagepalettetotruecolor($this->image->getCore());

        imagealphablending($this->image->getCore(), true);

        imagesavealpha($this->image->getCore(), true);
<?php             );

        }



        ob_start();

        imagebmp($this->image->getCore());

        $this->image->mime = defined('IMAGETYPE_BMP') ? image_type_to_mime_type(IMAGETYPE_BMP) : 'image/bmp';

        $buffer = ob_get_contents();