Download
<?php
if (empty($_GET['red'])){
$_GET['red'] = 0;
}
if (empty($_GET['green'])){
$_GET['green'] = 0;
}
if (empty($_GET['blue'])){
$_GET['blue'] = 0;
}
// Setup an image
$im = imagecreatetruecolor(372, 268);
$src1 = @imagecreatefromjpeg('shoe.jpg');
imagecopymerge($im, $src1, 0, 0, 0, 0, 372, 268, 100);
// Apply the overlay alpha blending flag
imagelayereffect($im, IMG_EFFECT_OVERLAY);
$src2 = @imagecreatefrompng('shoe2.png');
$red = imagecolorallocate($im, $_GET['red'], $_GET['green'], $_GET['blue']);
imagefill($src2, 33, 81, $red);
imagefill($src2, 157, 109, $red);
imagecopymerge($im, $src2, 0, 0, 0, 0, 372, 268, 100);
// Output
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
ไม่มีความคิดเห็น:
แสดงความคิดเห็น