note 80871 added to function.imagelayereffect
| From: | Remon at osu1 dot php dot net | Date: | Tue, 05 Feb 2008 09:12:38 +0000 |
| Subject: | note 80871 added to function.imagelayereffect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-135782@lists.php.net to get a copy of this message | ||
I found the following example on a Chinese site and translated and adjusted it. It creates a
portrait from the sample picture.
<?php
// Portrait image
$im = imagecreatefromjpeg( "sample.jpg");
// Get width and height
$w = imagesx($im);
$h = imagesy($im);
// Non-through
$c_visible = 0x007F7F7F;
// Background (black)
$c_bg = 0x00000000;
// Create mask
$im_mask = imagecreatetruecolor($w,$h);
imageFilledRectangle($im_mask, 0,0, $w,$h, $c_bg);
imageFilledEllipse ($im_mask, $w/2,$h/2, $w*.9,$h*.9, $c_visible);
// Only overlay seems to something useful
imagelayereffect($im_mask, IMG_EFFECT_OVERLAY);
imagecopy($im_mask, $im, 0,0, 0,0, $w,$h);
imagedestroy($im);
imagepng($im_mask);
imagedestroy($im_mask);
?>
Try removing the 'create mask' code and just add another image with
'createimagefromjpeg' to see 'normal' overlay. It blends the colors like
different layers in Photoshop.
----
Server IP: 217.13.201.10
Probable Submitter: 79.202.188.157
----
Manual Page -- http://www.php.net/manual/en/function.imagelayereffect.php
Edit -- https://master.php.net/note/edit/80871
Del: integrated -- https://master.php.net/note/delete/80871/integrated
Del: useless -- https://master.php.net/note/delete/80871/useless
Del: bad code -- https://master.php.net/note/delete/80871/bad+code
Del: spam -- https://master.php.net/note/delete/80871/spam
Del: non-english -- https://master.php.net/note/delete/80871/non-english
Del: in docs -- https://master.php.net/note/delete/80871/in+docs
Del: other reasons-- https://master.php.net/note/delete/80871
Reject -- https://master.php.net/note/reject/80871
Search -- https://master.php.net/manage/user-notes.php