So here's the optimized answer after you have provided the cv2 module.
Your answer showed the issue:
>>> import cv2
>>> img = cv2.imread('myimage.jpg', 0)
>>> img.dtype
dtype('uint8')
This means, as you correctly stated, that it is an unsigned 8-bit integer, which can only take values from 0-255.
You can, however, automatically convert the array to a better dtype which is much more memory efficient than doing int(value).
For example...
>>> img[0][0]
0
>>> img[0][0] -= 1
>>> img[0][0]
255 # since it's uint8
>>> img[0][0] += 1
>>> img2 = img.astype('uint16')
>>> img2[0][0] -= 1
>>> img2[0][0]
65535 # since it's uint16
You an also convert to other types other than uint8, 16, 32, and 64. For example...
>>> img3 = img2.astype('int64') # signed int64
>>> img3[0][0] -= 7000000
>>> img3[0][0]
-6934465
In short, rather than using Python's built-in type conversion, you can manually specify the dtypes from uint8-64 and int8-64 (and maybe more) using NumPy's dtypes, by specifying the newarray = array.astype('type'), creating a compact and efficient array using the new dtype. You can also specificy other types, such as 'int', 'bool', 'object', etc., showing the versatility and utility of NumPy arrays.
To read more about the dtypes and how to use them, the link to the SciPy documentation is here.