DIPlib Documentation - ©1995-2015 Quantitative Imaging Group, Delft University of Technology.

# Information about dyadic operations

There are two types of dyadic operations. First there are operations such as `Add`, `Sub`, etc... which take two input images. The second category consists of functions such as `AddFloat`, `AddComplex` etc... The data type of the output image given the data types of the input images is given by the following table:

| `dcomplex` | `scomplex` | `dfloat` | `sfloat` | `sint32` | `sint16`
`dcomplex` | `dcomplex` | `dcomplex` | `dcomplex` | `dcomplex` | `dcomplex` | `dcomplex`
`scomplex` | `dcomplex` | `scomplex` | `dcomplex` | `scomplex` | `scomplex` | `scomplex`
`dfloat` | `dcomplex` | `dcomplex` | `dfloat` | `dfloat` | `dfloat` | `dfloat`
`sfloat` | `dcomplex` | `scomplex` | `dfloat` | `sfloat` | `sfloat` | `sfloat`
`sint32` | `dcomplex` | `scomplex` | `dfloat` | `sfloat` | `sint32` | `sint32`
`sint16` | `dcomplex` | `scomplex` | `dfloat` | `sfloat` | `sint32` | `sint16`
`sint8` | `dcomplex` | `scomplex` | `dfloat` | `sfloat` | `sint32` | `sint16`
`uint32` | `dcomplex` | `scomplex` | `dfloat` | `sfloat` | `sint32` | `sint32`
`uint16` | `dcomplex` | `scomplex` | `dfloat` | `sfloat` | `sint32` | `sint16`
`uint8` | `dcomplex` | `scomplex` | `dfloat` | `sfloat` | `sint32` | `sint16`
`binary` | `dcomplex` | `scomplex` | `dfloat` | `sfloat` | `sint32` | `sint16`

| `sint8` | `uint32` | `uint16` | `uint8` | `binary` |
`dcomplex` | `dcomplex` | `dcomplex` | `dcomplex` | `dcomplex` | `dcomplex` |
`scomplex` | `scomplex` | `scomplex` | `scomplex` | `scomplex` | `scomplex` |
`dfloat` | `dfloat` | `dfloat` | `dfloat` | `dfloat` | `dfloat` |
`sfloat` | `sfloat` | `sfloat` | `sfloat` | `sfloat` | `sfloat` |
`sint32` | `sint32` | `sint32` | `sint32` | `sint32` | `sint32` |
`sint16` | `sint16` | `sint32` | `sint16` | `sint16` | `sint16` |
`sint8` | `sint8` | `sint32` | `sint16` | `sint8` | `sint8` |
`uint32` | `sint32` | `uint32` | `uint32` | `uint32` | `uint32` |
`uint16` | `sint16` | `uint32` | `uint16` | `uint16` | `uint16` |
`uint8` | `sint8` | `uint32` | `uint16` | `uint8` | `uint8` |
`binary` | `sint8` | `uint32` | `uint16` | `uint8` | `sint8` |

The output data type of an operation involving an image and a constant of one of the types: `dip_complex`, `dip_float`, `dip_int`, is given by the following table:

| `dip_complex` | `dip_float` | `dip_int`
`dcomplex` | `dcomplex` | `dcomplex` | `dcomplex`
`scomplex` | `scomplex` | `scomplex` | `scomplex`
`dfloat` | `dcomplex` | `dfloat` | `dfloat`
`sfloat` | `scomplex` | `sfloat` | `sfloat`
`sint32` | `scomplex` | `sint32` | `sint32`
`sint16` | `scomplex` | `sint16` | `sint16`
`sint8` | `scomplex` | `sint8` | `sint8`
`uint32` | `scomplex` | `uint32` | `uint32`
`uint16` | `scomplex` | `uint16` | `uint16`
`uint8` | `scomplex` | `uint8` | `uint8`
`binary` | `scomplex` | `sint8` | `sint8`