Use row and column addresses to set pixels in a small raster grid.

Example

Address pixels by row and column, then build a small pixel set.

highlighted = computed this step

Step 1 — Start with an empty grid

Rows count down; columns count right.

cells are addressed as (row,col)\text{cells are addressed as }(row,col)
Pixel grid basicsPixels A, B, and C are addressed by row and column.012340123

Step 2 — Set pixel A

Set pixel A at its row and column.

A=(0,0)A=( \hl{0} , \hl{0} )
Pixel grid basicsPixels A, B, and C are addressed by row and column.012340123A

Step 3 — Set pixel B

Set pixel B at its row and column.

B=(1,3)B=( \hl{1} , \hl{3} )
Pixel grid basicsPixels A, B, and C are addressed by row and column.012340123AB

Step 4 — Set pixel C

Set pixel C at its row and column.

C=(3,2)C=( \hl{3} , \hl{2} )
Pixel grid basicsPixels A, B, and C are addressed by row and column.012340123ABC
pixel-grid-basics A raster image is a grid of pixels. Each pixel is located by row and column, and those addresses are part of the data.