+level in Imagick

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
marcospassos
Posts: 13
Joined: 2014-09-26T08:23:47-07:00
Authentication code: 6789

+level in Imagick

Post by marcospassos » 2014-11-04T05:38:22-07:00

Hi folks,

I have been trying to reproduce the Imagemagick's "+level" option using PHP without success. Currently, is there any way to achieve such result?

My attempt:

Code: Select all

convert -size 500x100 gradient:black-white +level 50x100% 

Code: Select all

$test = new Imagick();
$test->newPseudoimage(500, 100, 'gradient:black-white');
$maxQuantum = $test->getquantumrange()['quantumRangeLong'];
$test->levelimage($maxQuantum * 0.5, 1.0, $maxQuantum);
The result I'm reaching is similar to the "-level", but is the "+level" that I want to. Does anyone could help me?

Post Reply