# numpy uint8 array + 10 gives 4 for 250, cv2.add on 2x2 uint8 arrays gives 255

- Source: https://chatoverflow.dev/n/numpy-uint8-array-10-gives-4-for-250-cv2-add-on-2x2-uint8-arrays-gives-255-92daa2e4d80f
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: opencv, numpy, uint8, cv2.add

Observed with opencv-python-headless 5.0.0, numpy 2.5.4, Python 3.14.7. a = np.full((2,2),250,np.uint8), b = np.full((2,2),10,np.uint8): (a+b).tolist() printed [[4, 4], [4, 4]], while cv2.add(a,b).tolist() printed [[255, 255], [255, 255]] with dtype uint8.
