imagecreatetruecolor

Supported Versions: PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8
Create a new true color image
<?php imagecreatetruecolor(int $width, int $height): GdImage|false
<?php                 ? strtolower($extension)

                : 'jpeg';



            $image = imagecreatetruecolor($width, $height);



            if (! function_exists($functionName = "image{$extension}")) {

                ob_get_clean();
<?php         $size = $image->getSize();




        $resource = imagecreatetruecolor($size->width, $size->height);




        if (is_null($matte)) {
<?php     protected function modify($image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)

    {


        $modified = imagecreatetruecolor($dst_w, $dst_h);




        $resource = $image->getCore();
<?php         $height = imagesy($resource);




        $canvas = imagecreatetruecolor($width, $height);




        imagealphablending($canvas, false);
<?php     public function newImage($width, $height, $background = null)

    {


        $core = imagecreatetruecolor($width, $height);

        $image = new Image(new static, $core);
<?php     {

        $width = imagesx($core);

        $height = imagesy($core);

        $clone = imagecreatetruecolor($width, $height);

        imagealphablending($clone, false);

        imagesavealpha($clone, true);

        $transparency = imagecolorallocatealpha($clone, 0, 0, 0, 127);
<?php     public function testGdApplyToImage()

    {

        $core = imagecreatetruecolor(300, 200);

        $image = Mockery::mock('\Intervention\Image\Image');

        $image->shouldReceive('getCore')->once()->andReturn($core);

        $circle = new CircleGd(250);
<?php     public function testGdApplyToImage()

    {

        $core = imagecreatetruecolor(300, 200);

        $image = Mockery::mock('\Intervention\Image\Image');

        $image->shouldReceive('getCore')->once()->andReturn($core);

        $ellipse = new EllipseGd(250, 150);
<?php     public function testApplyToImage()

    {


        $core = imagecreatetruecolor(300, 200);

        $image = Mockery::mock('\Intervention\Image\Image');

        $image->shouldReceive('getCore')->once()->andReturn($core);

        $line = new LineGd(10, 15);
<?php         $mask_image->shouldReceive('pickColor')->andReturn([0,0,0,0]);



        $canvas_image = Mockery::mock('Intervention\Image\Image');

        $canvas_core = imagecreatetruecolor(32, 32);

        $canvas_image->shouldReceive('getCore')->times(2)->andReturn($canvas_core);

        $canvas_image->shouldReceive('pixel');
<?php     public function testGd()

    {

        $mask_core = imagecreatetruecolor(32, 32);

        $mask = Mockery::mock('\Intervention\Image\Image');

        $mask->shouldReceive('getCore')->once()->andReturn($mask_core);
<?php     public function testGdApplyToImage()

    {

        $core = imagecreatetruecolor(300, 200);

        $image = Mockery::mock('\Intervention\Image\Image');

        $image->shouldReceive('getCore')->once()->andReturn($core);

        $polygon = new PolygonGd([1, 2, 3, 4, 5, 6]);
<?php     public function testApplyToImage()

    {


        $core = imagecreatetruecolor(300, 200);

        $image = Mockery::mock('\Intervention\Image\Image');

        $image->shouldReceive('getCore')->once()->andReturn($core);

        $rectangle = new RectangleGd(10, 15, 100, 150);