A bitmap image, also called a raster image, stores visual content as a two-dimensional grid of individually colored pixels. Zooming enlarges those pixels rather than preserving infinitely thin vector geometry. PNG and JPEG are common bitmap formats; JPEG saves space through lossy compression, while PNG preserves exact pixel values. section 9.1.1 section 9.7
Pixels can represent more than photographic color:
- RGBA values can encode emitted red, green, and blue light plus transparency. section 9.7
- Pixels can encode numerical data such as heat-map or tissue density values. section 9.1.1
- Palettes can assign category meanings to colors, such as countries on a map. section 9.1.1
- Scanning uses nested row-and-column loops; scanline order benefits performance. section 9.7
Exact pixels for a maze
A maze can use a PNG bitmap so wall, path, entrance, and treasure colors remain exact. In Go, decode the file with image/png, inspect pixels through Image.At or RGBAAt, compare known colors, and write pixels with RGBA.Set. section 9.1.1 section 9.7
> go doc image
package image // import "image"
[...]
type Image interface{ ... }
func Decode(r io.Reader) (Image, string, error)
type Point struct{ ... }
type RGBA struct{ ... }
func NewRGBA(r Rectangle) *RGBA
> go doc image.Point
type Point struct {
X, Y int
}
A Point is an X, Y coordinate pair. The axes increase right and down.
Go's image documentation exposes Image, Point, RGBA, decoding, and coordinate behavior; Point axes increase rightward and downward. section 9.1.1



