note 115876 added to imagick.painttransparentimage

From: Date: Tue, 07 Oct 2014 16:22:43 +0000
Subject: note 115876 added to imagick.painttransparentimage
Groups: php.notes 
Request: Send a blank email to php-notes+get-200603@lists.php.net to get a copy of this message
Have a look at this thread on Stackoverflow for the answer regarding how to determine the max intensity of an image. http://stackoverflow.com/questions/26239130/determine-max-possible-intensity-of-image/26240656#26240656 In short here is the code to make the $fuzz parameter behave more like you would expect (it now represents a percentage between 0-100). The $fuzz value should now be a float between 0 and 1. class SaneImagick extends Imagick { public function paintTransparentImage($target, $alpha, $fuzz) { $iQuantumDepth = pow(2, $this->getQuantumDepth()['quantumDepthLong']); return parent::paintTransparentImage($target, $alpha, $fuzz * $iQuantumDepth); } } ---- Server IP: 72.52.91.14 Probable Submitter: 50.243.157.62 ---- Manual Page -- http://php.net/manual/en/imagick.painttransparentimage.php Edit -- https://master.php.net/note/edit/115876 Del: integrated -- https://master.php.net/note/delete/115876/integrated Del: useless -- https://master.php.net/note/delete/115876/useless Del: bad code -- https://master.php.net/note/delete/115876/bad+code Del: spam -- https://master.php.net/note/delete/115876/spam Del: non-english -- https://master.php.net/note/delete/115876/non-english Del: in docs -- https://master.php.net/note/delete/115876/in+docs Del: other reasons-- https://master.php.net/note/delete/115876 Reject -- https://master.php.net/note/reject/115876 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#200603) next »