Selection parameters allow you to control how an alpha channel is derived from an image. For example you could create a transparency alpha channel based on parts of an image which were white.



The KeyColor parameter is the color you want to be transparent. You can specify this as percentages of red, green and blue however you may find it more useful to use a hex value or an absolute value between 0 and 255.

theObj.Select "notcolor", "keycolor=0d255,0d255,0d255 tolerance=10.0"
' select all parts of the image that are not white (or near to white)



Instead of a key color you can use a key location. This takes the color at the location you supply and uses it as the key color. This is useful in conjunction with imagemaps. For example:

theObj.Select "notcolor", "keylocation=150,150 tolerance=10.0"
theObj.SaveAs "D:\selectcolor1.png", ""



The tolerance is a percentage that shows how close a match you need - 0 means only the exact same color matches and 100 means anything matches.