Page 1 of 1

Need help porting IM docs mask example command to Imagick

Posted: 2007-12-11T22:21:18-07:00
by SkipperMcNally
I am trying to use a variant of the second masking example cited in the ImageMagick docs: http://www.imagemagick.org/Usage/channels/#masks.

The command I'm using is:

Code: Select all

convert input.jpg -negate -background White -channel A -combine output.png
which basically creates sort of a transparent white solarized image when a photograph is used as input.

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);
Any help would be greatly appreciated.