2D arrays · Raster images
Pixel Art
Place colored squares on a grid. The data structure behind every screen.
Every screen, every JPEG, every game sprite is a 2D array of color values. This demo lets you fill that array by hand. The grid you're drawing on is the same data structure your operating system holds in memory for every image on disk and every pixel on your monitor.
What’s happening under the hood
- ›Each cell is a (row, column) coordinate mapping to a color value — the underlying type is array-of-array, the same shape JavaScript reaches for as Uint8ClampedArray on a canvas.
- ›Memory layout matters: row-major arrays make horizontal scans cache-friendly, vertical scans cache-hostile. This shows up as measurable speed differences in production graphics code.
- ›Real images add compression (JPEG, PNG, WebP) on top of this same raster substrate. The pixels are still there; the encoding gets cleverer.
Dig deeper
Phase 0 · How Computers ThinkThe concept you just explored is taught with full depth in the formal DURA curriculum.