note 104528 added to function.imagefilter

From: Date: Tue, 21 Jun 2011 13:58:48 +0000
Subject: note 104528 added to function.imagefilter
Groups: php.notes 
Request: Send a blank email to php-notes+get-180805@lists.php.net to get a copy of this message
For people looking to apply a 'multiply' effect on images like the one in Photoshop (generally b&w ones), you can achieve it with the IMG_FILTER_COLORIZE filter. <?php function multiplyColor(&$im, $color = array(255, 0, 0)) { //get opposite color $opposite = array(255 - $color[0], 255 - $color[1], 255 - $color[2]); //now we subtract the opposite color from the image imagefilter($im, IMG_FILTER_COLORIZE, -$opposite[0], -$opposite[1], -$opposite[2]); } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 81.148.37.119 ---- Manual Page -- http://www.php.net/manual/en/function.imagefilter.php Edit -- https://master.php.net/note/edit/104528 Del: integrated -- https://master.php.net/note/delete/104528/integrated Del: useless -- https://master.php.net/note/delete/104528/useless Del: bad code -- https://master.php.net/note/delete/104528/bad+code Del: spam -- https://master.php.net/note/delete/104528/spam Del: non-english -- https://master.php.net/note/delete/104528/non-english Del: in docs -- https://master.php.net/note/delete/104528/in+docs Del: other reasons-- https://master.php.net/note/delete/104528 Reject -- https://master.php.net/note/reject/104528 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#180805) next »