How is the information of a digital two-dimensional image organized and stored?

In a spreadsheet.
In Python ints and floats.
In a list of polygons and vertices.
In a grid of discrete elements.