note 114451 added to imagick.contraststretchimage
| From: | SkepticaLee | Date: | Fri, 21 Feb 2014 18:47:21 +0000 |
| Subject: | note 114451 added to imagick.contraststretchimage | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198587@lists.php.net to get a copy of this message | ||
Trying to figure out what values the black and white points can have and what their effects are
nearly drove me around the bend. However, this works:
<?php
$width = 480;
$height = 360;
$mask = new Imagick ();
$mask->newImage ($width, $height, "black");
$draw = new ImagickDraw ();
$draw->setFillColor ("white");
$draw->ellipse ($width / 2, $height / 2, $width * 5 / 12, $height * 5 / 12, 0, 360);
$mask->drawImage ($draw);
$mask->blurImage (0, 50);
$mask->contrastStretchImage (10, 125000);
$mask->writeImage ("mask.png");
?>
The result will be a vignette mask with the pixels in the corner being pure black, and the ones in
the middle pure white (which is not the case if the line is commented out). Reducing the white value
to, say, 100, turns most of the grey pixels white.
----
Server IP: 213.172.110.14
Probable Submitter: 89.182.149.57
----
Manual Page -- http://php.net/manual/en/imagick.contraststretchimage.php
Edit -- https://master.php.net/note/edit/114451
Del: integrated -- https://master.php.net/note/delete/114451/integrated
Del: useless -- https://master.php.net/note/delete/114451/useless
Del: bad code -- https://master.php.net/note/delete/114451/bad+code
Del: spam -- https://master.php.net/note/delete/114451/spam
Del: non-english -- https://master.php.net/note/delete/114451/non-english
Del: in docs -- https://master.php.net/note/delete/114451/in+docs
Del: other reasons-- https://master.php.net/note/delete/114451
Reject -- https://master.php.net/note/reject/114451
Search -- https://master.php.net/manage/user-notes.php