img, err := os.Open("image.jpg") if err != nil { log.Fatal(err) } defer img.Close() src, _, err := image.Decode(img) if err != nil { log.Fatal(err) } dst := image.NewRGBA(image.Rect(0, 0, 100, 100)) draw.CatmullRom.Scale(dst, dst.Bounds(), src, src.Bounds(), draw.Over, nil) out, err := os.Create("image-resized.jpg") if err != nil { log.Fatal(err) } defer out.Close() jpeg.Encode(out, dst, nil)In this example, we open the image file "image.jpg" and decode it using the image.Decode function. We then create a new RGBA image with a size of 100x100, and use the draw.CatmullRom.Scale function to resize the source image to fit the new image size. Finally, we encode the resized image as a JPEG and save it to "image-resized.jpg". The package library in use here is the "image" package, which is part of the standard Go library.