import ( "image" "image/color" "image/png" "os" ) func main() { // Load an existing grayscale image file, _ := os.Open("input.png") img, _ := png.Decode(file) file.Close() // Set the first pixel in the image to a new grayscale value newGray := uint8(200) img.(*image.Gray).SetGray(0, 0, color.Gray{newGray}) // Save the modified image to a file outFile, _ := os.Create("output.png") png.Encode(outFile, img) outFile.Close() }In this example, we load an existing grayscale image from a file, set the grayscale value of the first pixel to a new value of 200, and save the modified image to a new file called "output.png". Package Library: Image - Go standard library.