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);