PhotoController provides a collection of composition filters, which all inherit from BaseCompositeFilter. These filters have two common properties:
- BackgroundBitmap
The other image you want to composite.
- Position
The position of the compositing image.
Composition always requires two images. The one encapsulated in the controller is considered as the foreground image; the one loaded in the filter object is considered as the background image. Composition is an operation to merge the color pixel of two images in order to acieve a new image. Not all images can be composited beautifully, it's better to understand how each composite filter works. The following figures demonstrate some of generated result.
First, let's see the two source images we will composite:
AdditionCompositeFilter
Adds color components to achieve a brightening effect. For example, black color is #000000, which means every color adds a black color is equal to itself. You can see from the result, the image becomes brighter due to the color addition.
DifferenceCompositeFilter
Subtracts either the source image sample color from the background image sample color, or the reverse, depending on which sample has the greater brightness value.
MultiplyCompositeFilter
Multiplies the color component of two input images and creates an output image using the multiplied values.
LightenCompositeFilter
Creates composite image samples by choosing the lighter samples (either from the source image or the background).
DarkenCompositeFilter
Creates composite image samples by choosing the darker samples (from either the source image or the background).
ScreenCompositeFilter
Multiplies the inverse of the source image samples with the inverse of the background image samples.
ExclusiveCompositeFilter
Produces an effect with a lower contrast difference.
SimilarityRemovalFilter
Compares the background image to the source image, if two pixel color are similar (the difference of two colors is less than the threashold), use the source color; otherwise, use the background image color. In this example, the threshold is 0.4
[Back to Top]