My question is somewhat similar to this one, but I couldn't figure out how to make it work for me. I want to convert a grayscale bmp of arbitrary size into a list of lists with values between 0 and 255.
For example:
If input looks like this:
The output should be:
pic = [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
[255, 255, 127, 127, 127, 127, 127, 127, 255, 255],
[255, 255, 127, 127, 127, 127, 127, 127, 255, 255],
[255, 255, 127, 127, 0 , 0 , 127, 127, 255, 255],
[255, 255, 127, 127, 0 , 0 , 127, 127, 255, 255],
[255, 255, 127, 127, 127, 127, 127, 127, 255, 255],
[255, 255, 127, 127, 127, 127, 127, 127, 255, 255],
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255],
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]
I have almost no experience in image processing.