public function merge(
        Image $srcImage,
        $dstX,
        $dstY,
        $strategy = self::MERGE_SCALE_SRC
    ) {
        if (!is_resource($this->image) || !is_resource($srcImage->image)) {
            throw new \RuntimeException(
                'Attempt to merge image data using an invalid image resource.'
            );
        }

        // determine re-sampling strategy
        switch ($strategy) {
            // merge using the destination image dimensions
            case self::MERGE_SCALE_DST:
                $dstWidth = $this->width;
                $dstHeight = $this->height;

                break;

            // merge using the destination image dimensions, do not upscale
            case self::MERGE_SCALE_DST_NO_UPSCALE:
                $dstWidth = $this->width;
                if ($dstWidth > $srcImage->width) {
                    $dstWidth = $srcImage->width;
                }

                $dstHeight = $this->height;
                if ($dstHeight > $srcImage->height) {
                    $dstHeight = $srcImage->height;
                }

                break;

            // merge using the source image dimensions
            case self::MERGE_SCALE_SRC:
            default:
                $dstWidth = $srcImage->width;
                $dstHeight = $srcImage->height;
        }

        // copy images around
        @imagecopyresampled(
            $this->image,
            $srcImage->image,
            (int)$dstX,
            (int)$dstY,
            0,
            0,
            (int)$dstWidth,
            (int)$dstHeight,
            $srcImage->width,
            $srcImage->height
        );

        return $this;
    }