Ask Your Question

Revision history [back]

Issue with np.zeros() while trying to get a black background

I am using img = np.zeros((512 , 512 , 3) , np.int8) to get a black ground but I am getting a Gray background instead

image description

When i removed np.uint8 and used the default np.float64 I am getting the black background

image description

Why is this happening?

Also when i printed img array in both cases i got the same zero array of shape (512 , 512 , 3)in both cases.