adding a way to retrieve pixel values from the matrix