| Operation | Inputs | Set Operation | Truth Table |
|---|---|---|---|
| AND | Image A, Image B | Intersection (A ∩ B) | 1 only where both inputs are 1 |
| OR | Image A, Image B | Union (A ∪ B) | 1 where either input is 1 |
| NOT | Image A | Complement (Aᶜ) | Inverts: 0→1, 1→0 |
| XOR | Image A, Image B | Symmetric Difference (A △ B) | 1 where inputs differ |
For binary mask images (0/1 values), these correspond exactly to set operations on the foreground regions. Common compound expressions:
- A AND NOT B — Region A excluding region B (set difference)
- NOT (A OR B) — Everything outside both regions
- (A OR B) AND NOT (A AND B) — Equivalent to XOR (exclusive regions)