convert +level-colors equivalent in MagickWand

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply
mrBlaQ
Posts: 17
Joined: 2008-02-05T12:19:00-07:00

convert +level-colors equivalent in MagickWand

Post by mrBlaQ »

I see the +level-colors flag was added to convert about a week after the latest version of MagickWand. I really need this functionality in MW. Does anyone know if there is an equivalent function in MW?

What I'm trying to do is take a PNG with some plain white text on it and a mask around that text and change the text color to any other color I want while preserving the mask.

Thanks so much!

8) :? :) :D :lol: :lol: :lol: 8) 8) :shock: :o :D
mrBlaQ
Posts: 17
Joined: 2008-02-05T12:19:00-07:00

Re: convert +level-colors equivalent in MagickWand

Post by mrBlaQ »

My best solution seems too involved. But, here it is:

Load image $a
Create copy $b
Fill $a with new color (MW_ResetMethod)
Separate alpha mask from $b
Invert $b
Composite $b on to $a (MW_CopyOpacityCompositeOp)
Save a$
Post Reply