PNG is a lossless raster image format: it stores a two-dimensional grid of colored pixels while preserving exact values needed for walls, paths, entrances, and treasures. section 9.1.1
PNG fits image-processing tasks that depend on precise pixel data:
- Represents indexed, grayscale, or truecolor images, with optional transparency. section 9.0
- Decodes through Go’s image/png package into an image.Image, often accessed as RGBA or NRGBA. section 9.7
- Reads pixels with At or RGBAAt and writes RGBA pixels with Set. section 9.7
Concurrent maze solver
A command-line Go tool reads a PNG RGBA maze, explores its branches concurrently, and writes another PNG with the entrance-to-treasure path highlighted. section 9.0
> 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.
Browse Go’s image interfaces, RGBA type, decoding function, and coordinate representation for working with PNG pixels. section 9.1.1

