note 114689 added to imagick.colorizeimage
| From: | AlexLokhman | Date: | Sat, 22 Mar 2014 14:35:02 +0000 |
| Subject: | note 114689 added to imagick.colorizeimage | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199014@lists.php.net to get a copy of this message | ||
If you're looking for a solution to fill the image with a solid color, preserving background
transparency, here is one way:
<?php
$im = new Imagick('image.png');
$im->setImageAlphaChannel(Imagick::ALPHACHANNEL_EXTRACT);
$im->setImageBackgroundColor('color');
$im->setImageAlphaChannel(Imagick::ALPHACHANNEL_SHAPE);
$im->writeImage('output.png');
$im->destroy();
?>
----
Server IP: 72.52.91.14
Probable Submitter: 86.178.98.239
----
Manual Page -- http://php.net/manual/en/imagick.colorizeimage.php
Edit -- https://master.php.net/note/edit/114689
Del: integrated -- https://master.php.net/note/delete/114689/integrated
Del: useless -- https://master.php.net/note/delete/114689/useless
Del: bad code -- https://master.php.net/note/delete/114689/bad+code
Del: spam -- https://master.php.net/note/delete/114689/spam
Del: non-english -- https://master.php.net/note/delete/114689/non-english
Del: in docs -- https://master.php.net/note/delete/114689/in+docs
Del: other reasons-- https://master.php.net/note/delete/114689
Reject -- https://master.php.net/note/reject/114689
Search -- https://master.php.net/manage/user-notes.php