public function create(int $width, int $height, bool $true_color = true): bool
    {
        $this->image_width = $width;
        $this->image_height = $height;

        if (!$this->haveEnoughMemoryToOpenAndProcess()) {
            throw new RuntimeException('Empty can not be created.');
        }

        if ($true_color) {
            $img = imagecreatetruecolor($width, $height);
        } else {
            $img = imagecreate($width, $height);
        }

        $this->image_resource = $img;

        return true;
    }
public function create(int $width, int $height, bool $true_color = true): bool
    {
        $this->image_width = $width;
        $this->image_height = $height;

        if (!$this->haveEnoughMemoryToOpenAndProcess()) {
            throw new RuntimeException('Empty can not be created.');
        }

        if ($true_color) {
            $img = imagecreatetruecolor($width, $height);
        } else {
            $img = imagecreate($width, $height);
        }

        $this->image_resource = $img;

        return true;
    }
public function create ( int $ width , int $ height , bool $ true_color = true ) : bool { $ this -> image_width = $ width ; $ this -> image_height = $ height ; if ( ! $ this -> haveEnoughMemoryToOpenAndProcess ( ) ) { throw new RuntimeException ( 'Empty can not be created.' ) ; } if ( $ true_color ) { $ img = imagecreatetruecolor ( $ width , $ height ) ; } else { $ img = imagecreate ( $ width , $ height ) ; } $ this -> image_resource = $ img ; return true ; }
Create empty image to work with, used for creation from non-source

@param int  $width
@param int  $height
@param bool $true_color

@return bool

@throws RuntimeException
Create empty image to work with used for creation from non - source