I need to convert the ImageMagick Command to PHP Imagick. I have tried a few combinations but nothing worked as expected. The command creates a line with pointy edges and gradient at the edges The command is:
convert -size 300x1 xc:red \
\( -size 1x300 gradient: -rotate 90 -solarize 50% -level 0x50% -white-threshold 50% +write grad.png \) \
-alpha off -compose copy_opacity -composite red_grad.png`
thanks to @fmw42 for this command
I have tried the following code:
$line = new Imagick();
$line->newPseudoImage(300,1,'xc:red');
$shadow = new Imagick();
$shadow->newPseudoImage(1, 300, 'gradient:red-white');
$shadow->rotateImage('transparent', 90);
$shadow->solarizeImage(50);
$shadow->levelImage(0,50,50);
$shadow->whiteThresholdImage('white');
$shadow->setImageCompose(0);
$shadow->writeImage('grad.png');
$shadow->compositeImage($line, Imagick::COMPOSITE_MATHEMATICS, 0, 0);
Please point out where am I going wrong