# Synopse

• a: Image
• f: Image Image
• c: Image Constant
```01. from numpy import *
02.
04.     from ialimits import ialimits
05.
06.     if not c:
07.        return f
08.     if f.dtype == 'float64':
09.         y = f + c
10.     else:
11.         y = asarray(f,int64) + c
12.         k1,k2 = ialimits(f)
13.         y = ((f==k1) * k1) + ((f!=k1) * y)
14.         y = clip(y,k1,k2)
15.     a = y.astype(f.dtype)
16.     return a```

# Examples

With "float64" data type

```1. import ia870 as ia
2.
3. f = array([-inf, -30, 4, 33, inf])
4. print 'f.dtype', f.dtype
5. print 'f:',f
```f.dtype float64
f: [-inf -30.   4.  33.  inf]
f + 3: [-inf -27.   7.  36.  inf]
f - 10 [-inf -40.  -6.  23.  inf]
```

With "int32" data type

```1. a = arange(8).astype('int32')
2. k1,k2 = ia.ialimits(a)
3. f = array([k1,-3,0,5,10,k2]).astype('int32')
4. print 'f.dtype', f.dtype
5. print 'f:',f
```f.dtype int32
f: [-2147483647          -3           0           5          10  2147483647]
f + 3: [-2147483647           0           3           8          13  2147483647]
f - 10 [-2147483647         -13         -10          -5           0  2147483637]
```

With 'uint8' data type

```1. a = arange(8).astype('uint8')
2. k1,k2 = ia.ialimits(a)
3. f = array([k1,5,10,100,k2]).astype('uint8')
4. print 'f.dtype', f.dtype
5. print 'f:',f
```f.dtype uint8