I have a NumPy array of 3,076,568 binary values (1s and 0s). I would like to convert this to a matrix, and then to a grayscale image in Python.
However, when I try to reshape the array into a 1,538,284 x 1,538,284 matrix, I get a memory error.
How can I reduce the size of the matrix so that it will turn into an image that will fit on a screen without losing the uniqueness/data?
Furthermore, how would I turn it into a grayscale image?
Any help or advice would be appreciated. Thank you.