Hi,
You can divide your gray scale image array by 255.0 (if you have 8-bit image because for 8-bit image pixel intensities ranges from 0 to 255) (if you have n-bit image then this number would be 2**n - 1) and apply .round() function to get binary image.