Victor Image Processing Library How-to Tips

Combine Images                                                      

addimage
addtexture
andimage
bleachimage
copyimage
cover
coverclear
darker
difference
differenceabs
divideimage
isolate
lighter
multiplyimage
multnegimage
orimage
subimage
wtaverage
xorimage

Source

Operator

Result

The Victor Library provides many ways that images can be combined. These examples are all using grayscale images where black pixels have the value zero and white pixels have the value 255. If a computed result pixel value is greater than 255 it is set to 255. If a result value is less than zero it is set to zero.

These functions operate on 8-bit grayscale and 24-bit RGB color images. The bitwise AND, OR, and XOR functions also operate on 1-bit black and white images.

FunctionOperationDescription
addimageResult = Source + OperatorAdd two images
addtextureResult = Source + Operator - 128 Put a texture onto an image
andimageResult = Source AND OperatorBitwise AND two images
bleachimage Result = (255-Source) * (255-Operator) / 255 Unusual effect
copyimage Result = SourcePlace side-by-side, top-to-bottom, or copy to any position
cover if Operator > threshold then
Result = Operator
if Operator <= threshold then
Result = Source
Overlay two images, transparent range of colors
coverclear if Operator = transcolor then
Result = Source
else
Result = Operator
Overlay two images, transparent color
darker if Source < Operator then
Result = Source
else
Result = Operator
Darker pixels of each image
difference Result = Source - Operator + 128 Positive difference is bright, negative difference is dark
differenceabs Result = | Source - Operator| Absolute value of the difference
divideimage Result = Source / Operator Divide one image by the other
isolate Result = (Source + Operator) Operator is black area to isolate and white elsewhere
lighter if Source > Operator then
Result = Source
else
Result = Operator
Lighter pixels of each image
multiplyimage Result = Source * Operator / 255 Multiply two images
multnegimage Result = 255 - ((255-Source) * (255-Operator) / 255)Unusual effect
orimage Result = Source OR Operator Bitwise OR two images
subimage Result = Source - Operator Subtract two images
wtaverageResult = (weight * Source + (100 - weight) * Operator) / 100 Weighted average of two images
xorimage Result = Source XOR Operator Bitwise XOR two images
correlationcoef Calculate the correlation coefficient between two images as a double precision floating point number
correlateimages Calculate the correlation coefficient between the Operator image and the Source image at every pixel position in the Source image and places the scaled coefficient data in the Result image.


Victor Image Processing Library

Victor Image Processing Library homepage | Victor Product Summary | more Source code




Copyright © 2003 Catenary Systems Inc. All rights reserved. Victor Image Processing Library is a trademark of Catenary Systems.