I wonder how I can create a matrix with pixel colors information from a figure on R. As in the example, the idea is process an grayscale image to a matrix like this:
[,1] [,2] [,3]
[1,] "Black" "White" "Black"
[2,] "White" "Black" "White"
[3,] "Black" "White" "White"