img := image.NewRGBA(image.Rect(0, 0, 100, 100)) x, y := 50, 50 offset := img.PixOffset(x, y)
img := image.NewRGBA(image.Rect(0, 0, 100, 100)) x, y := 50, 50 offset := img.PixOffset(x, y) img.Pix[offset] = 255 img.Pix[offset+1] = 0 img.Pix[offset+2] = 0 img.Pix[offset+3] = 255This code creates a new RGBA image with dimensions of 100x100 pixels, then sets the color of the pixel at (50, 50) to red. The Go image package is used to manipulate images and is part of the standard library.