1--TEST--
2Testing imagecopymergegray() of GD library
3--CREDITS--
4Sean Fraser <frasmage [at] gmail [dot] com>
5PHP[tek] 2017
6--SKIPIF--
7<?php
8if (!extension_loaded("gd")) die("skip GD not present");
9?>
10--FILE--
11<?php
12
13$des = imagecreate(120, 120);
14$src = imagecreate(100, 100);
15
16$color_des = imagecolorallocate($des, 50, 50, 200);
17$color_src = imagecolorallocate($src, 255, 255, 0);
18
19imagefill($des, 0, 0, $color_des);
20imagefill($src, 0, 0, $color_src);
21
22var_dump(imagecopymergegray($des, $src, 20, 20, 0, 0, 50, 50, 75));
23
24$color = imagecolorat($des, 30, 30);
25$rgb = imagecolorsforindex($des, $color);
26echo $rgb['red'], ", ", $rgb['green'], ", ", $rgb['blue'], "\n";
27
28?>
29--EXPECT--
30bool(true)
31208, 208, 16
32