In order to analyze the pixels I used an input file containing a set of values which defined ranges for the hue, saturation, and value of the blue pixels I wanted to remove, and one extra value which would help create a better transition around the images.

The text file looked something like this: 200 260 40 0.60 0.85 0.3 0.24 0.65 0.3

So, the hue range was 200 - 260 with a fuzz distance of 40.

The saturation range was .6 - .85 and the fuzz distance was not actually used in the program.

The value range was .24 - .65 and the fuzz distance was also not used.

The resulting alpha mask and premultiplied foreground image looked like this:

           

As you can see the edge was a bit too rough, so I applied a basic average filter across the entire alphamask and ended up with something like this:

           

 

           

           

          

          

          

     

copyright 2005 dave morris.