Contents
The basic image merging operations defined by Porter and Duff in their 1984 paper, with a couple of additions. All these operations are methods of Image and return a new Image instance.
Each of the following operations is illustrated with these foreground and background images:
ice.Image Over(fg)
The image being operated on is the background image.
Parameters
fg
Foreground image (ice.Image).
Example
fg = ice.Load('teapot.tif') bg = ice.Load('tinbox.tif') result = bg.Over(fg)
ice.Image Cover(fg)
Correlated Over operation. Similar to Over, but works better for correlated subpixel coverage.
Parameters
fg
Foreground image (ice.Image).
Example
fg = ice.Load('teapot.tif') bg = ice.Load('tinbox.tif') result = bg.Cover(fg)
ice.Image MergeAtop(fg)
Merge "atop".
Parameters
fg
Foreground image (ice.Image).
Example
fg = ice.Load('teapot.tif') bg = ice.Load('tinbox.tif') result = bg.MergeAtop(fg)
ice.Image In(fg)
Merge "in".
Parameters
fg
Foreground image (ice.Image).
Example
fg = ice.Load('teapot.tif') bg = ice.Load('tinbox.tif') result = bg.MergeXOR(fg)
ice.Image MergeXOR(fg)
Merge XOR operation.
Parameters
Example
fg = ice.Load('teapot.tif') bg = ice.Load('tinbox.tif') result = bg.MergeXOR(fg)
ice.Image Out(fg)
Merge out operation.
Parameters
fg
Foreground image (ice.Image).
Example
fg = ice.Load('teapot.tif') bg = ice.Load('tinbox.tif') result = bg.Out(fg)
ice.Image TransmissionFilter(fg)
In this operation, the foreground acts as a color filter for the background.
Parameter
fg
Foreground image (ice.Image).
Example
fg = ice.Load('teapot.tif') bg = ice.Load('tinbox.tif') result = bg.TransmissionFilter(fg)
ice.Image AlphaDivide()
Divide image by alpha channel.
ice.Image AlphaMultiply()
Multiply image by alpha channel.