It's not the most efficient solution, but this can be optimized later. It's best to copy out all the pixels at once into a list, rather than accessing them one by one.
It's not the most efficient solution, but this can be optimized later. It's best to copy out all the pixels at once into a list, rather than accessing them one by one.