PictureEffects Xojo and Real Studio Plugin

ChromaKeyEffect.CreateKeyMask Method

Creates a mask by using a Chroma Key algorithm. Chroma Key algorithms are to mask out special background material which can be either green or blue. Only Green is supported currently.

CreateKeyMask(
   source as Picture,
   baseLevel as Double,
   shadowThreshold as Double,
   mask as Picture) as Picture

Parameters

source
The source picture to work with.
baseLevel
Sets the base level of the Green Chroma color, 0.0 is for very greenish Chroma background and when going towards 1.0 then it will work on more green-yellowish chroma backgrounds. (The range of this parameter is from 0.0 to 1.0).
shadowThreshold
The threshold of shadow levels. This value should be from 0.0 to 1.0. If doing a Chroma Keying without any user interaction then leave this value at 0.0 or 0.39 at most.
mask
To limit the filtering to certain pixels then set a picture defining the mask to this parameter. Pass nil to this parameter if the filtering should not be limited to certain pixels.

The mask picture must be a 32 bit picture and must be same size as the src picture. If the mask picture is not 32 bits and same size as the src picture then the function will fail and leave the result picture unchanged.

Returns

Picture
Returns a 32 bit Grayscale Mask.

Remarks

See Also

ChromaKeyEffect Class