The command I'm using is:
Code: Select all
convert input.jpg -negate -background White -channel A -combine output.png
I have tried the following with no luck, it just creates a negative:
Code: Select all
$src = new Imagick("input.jpg");
$src->setImageFormat("png");
$src->negateImage(false);
$src->setBackgroundColor(new ImagickPixel("White"));
$src->combineImages(Imagick::CHANNEL_ALPHA);
$src->writeImage(output.png);