Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
the -fuzz XX where XX is some percent say 40% allows other colors near green to be converted to white.
You can also try floodfilling:
convert green.jpg -fill white -fuzz 40% -floodfill +0+0 "rgb(0,255,2)" green_white40.jpg
Alternately, you may need to use some masking technique to extract the face from the green background and then composite it back onto a white background.
but point of my question is that i want any background
your method is suitable for background created by myself or manipulated by IM
in my requirement, background should be freewill, from real photo or computer graphics, not only described by IM
in fact, i try use ChangeMask mode in composite to get 32-bit image with alpha, then composite with any background
---i thinks it's alternate way mentioned by you
but i worried about this method whether is exact. i heard about color blending which is technically for my demand, but i don't know this operation whether has same effect as color blending
I don't know what you mean by color blending. IM can blend two images, but that won't change one background to another. The only way I know to change the background to another picture is to make the green background transparent and compose that image over a new background image. Or make a binary mask image and use that to control the overlay of the one image with a new background.
But since your face has both black and white areas, it may not be easy to process the mask. I tried doing so from one of the red, or green or blue channels of the image, but with no good results. You may have to trace the outline manually in some other program to make the mask.
However if you want to try to present any anti-aliased or 'blended' pixels (is this what you mean by blending?) Then you may have to do some more advanced color replacements, involving splitting the image into 'definate foreground' 'definate background' and 'blended or anti-aliased pixels'.
With that tree image separation you can do any special handling needed for the blended pixels.