code: func Save(img image.Image, filename string, opts ...EncodeOption) (err error) {
  	f, err := FormatFromFilename(filename)
  	if err != nil {
  		return err
  	}
  	file, err := fs.Create(filename)
  	if err != nil {
  		return err
  	}
  	err = Encode(file, img, f, opts...)
  	errc := file.Close()
  	if err == nil {
  		err = errc
  	}
  	return err
  }
docs: // Save saves the image to file with the specified filename.
  // The format is determined from the filename extension:
  // "jpg" (or "jpeg"), "png", "gif", "tif" (or "tiff") and "bmp" are supported.
  //
  // Examples:
  //
  //	// Save the image as PNG.
  //	err := imaging.Save(img, "out.png")
  //
  //	// Save the image as JPEG with optional quality parameter set to 80.
  //	err := imaging.Save(img, "out.jpg", imaging.JPEGQuality(80))
  //