Page 1 of 1

convert +level-colors equivalent in MagickWand

Posted: 2009-01-05T12:10:59-07:00
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

Re: convert +level-colors equivalent in MagickWand

Posted: 2009-01-05T14:46:15-07:00
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$