Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Copy part of an image
<?php imagecopy(    GdImage $dst_image,    GdImage $src_image,    int $dst_x,    int $dst_y,    int $src_x,    int $src_y,    int $src_width,    int $src_height): bool
<?php             $base = $image->getDriver()->newImage($width, $height)->getCore();

            imagecopy($base, $resource, 0, 0, 0, 0, $width, $height);




            imagefill($resource, $x, $y, $filling);
<?php             imagefill($resource, $x, $y, $filling);




            imagecopy($base, $resource, 0, 0, 0, 0, $width, $height);




            $image->setCore($base);
<?php         imagealphablending($image->getCore(), true);

        return imagecopy($image->getCore(), $watermark->getCore(), $target->x, $target->y, 0, 0, $watermark_size->width, $watermark_size->height);

    }

}
<?php         imagecolortransparent($resource, $matte);




        imagecopy($resource, $image->getCore(), 0, 0, 0, 0, $size->width, $size->height);



        if (is_numeric($count) && $count <= 256) {
<?php         imagefilledrectangle($canvas->getCore(), $dst_x, $dst_y, $dst_x + $src_w - 1, $dst_y + $src_h - 1, $transparent);




        imagecopy($canvas->getCore(), $image->getCore(), $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h);




        $image->setCore($canvas->getCore());
<?php         imagealphablending($canvas, true);




        imagecopy($canvas, $resource, 0, 0, 0, 0, $width, $height);

        imagedestroy($resource);



        $resource = $canvas;
<?php         $transparency = imagecolorallocatealpha($clone, 0, 0, 0, 127);

        imagefill($clone, 0, 0, $transparency);

        

        imagecopy($clone, $core, 0, 0, 0, 0, $width, $height);



        return $clone;

    }