package main import ( "image" "image/color" "image/draw" "image/png" "os" "golang.org/x/image/colornames" ) func main() { width := 200 height := 200 bounds := image.Rect(0, 0, width, height) img := image.NewRGBA(bounds) // Draw a blue rectangle draw.Draw(img, bounds, &image.Uniform{color.RGBA{0, 0, 255, 255}}, image.Point{}, draw.Src) // Draw a red rectangle with dy offset of 50 rect := image.Rect(0, 50, 100, 100) draw.Draw(img, rect.Add(image.Pt(0,50)), &image.Uniform{colornames.Red}, image.Point{}, draw.Src) // Save the image as PNG f, err := os.Create("rectangle_dy.png") if err != nil { panic(err) } defer f.Close() png.Encode(f, img) }This code example creates a 200x200 image and draws two rectangles on it. The first rectangle is blue and fills the entire image, while the second rectangle is red and is offset by dy=50 pixels from the top of the image. The resulting image is saved as a PNG file named "rectangle_dy.png". The package library used in this example is "image", which is a standard Go package.