---
title: "IceMan - Compositing"
canonical: "https://rmanwiki-25.pixar.com/space/REN25/20415471/IceMan%20-%20Compositing"
format: markdown
---
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:

|  |  |  |  |
| --- | --- | --- | --- |
| ![teapot_1.jpg](media://83101765-d3a1-40ea-bcca-aadfe84951a8) | ![teapot_2.jpg](media://5ca997ec-5bc8-443c-988f-4d7be7a5fd23) | ![tinbox.jpg](media://9560e35e-b8b5-4f51-b864-b648c3bf895a) | ![tinbox_2.jpg](media://477466d0-520c-4d38-ac15-5d02b3b56afb) |

  


## **ice.Image Over(***fg***)**

The image being operated on is the background image.

### Parameters

*fg*

Foreground image (ice.Image).

### Example

![over.jpg](media://30d389fa-44d7-4c61-ba5c-6e8125486640)

```
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

![cover.jpg](media://0a92e4f8-c960-4b4a-8bde-7635055dff8a)

```
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

![mergeatop.jpg](media://e1a091d8-adcf-4441-8160-23bbf03688ba)

```
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

![in.jpg](media://60c0adfd-20f3-4be9-a223-75410668e697)

```
fg = ice.Load('teapot.tif')
bg = ice.Load('tinbox.tif')
result = bg.MergeXOR(fg) 
```

  


## **ice.Image MergeXOR(***fg***)**

Merge XOR operation.

### Parameters

  


*fg*

  


Foreground image (ice.Image).

  


### Example

![mergexor.jpg](media://f15185d9-9690-4ddb-95d0-b565b59e5dee)

```
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

![out.jpg](media://6a53fc89-98da-4e8f-96a7-0d96bd3d1d0e)

```
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

![transmissionfilter.jpg](media://d9243cbe-363d-488f-b142-f8e1f6115161)

```
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.