API Reference
Command
Save-Image
Saves an image to disk or returns its encoded bytes as a stream.
Remarks
Use this cmdlet to persist an Image instance after applying transformations.
Examples
Overwrite the source file
PS>
Save-Image -Image $img
Save as JPEG with quality 80
PS>
Save-Image -Image $img -FilePath out.jpg -Quality 80
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Save-Image [-AsStream] [-CompressionLevel <Int32>] [-FilePath <String>] -Image <Image> [-Open] [-Quality <Int32>] [<CommonParameters>]#Parameter set:
All Parameter SetsParameters
- AsStream SwitchParameter
- When used without FilePath, the cmdlet writes a stream object to the pipeline.
- CompressionLevel Int32
- Compression level for PNG images.
- FilePath String
- When omitted, the image is saved using the path already associated with the image object.
- Image Image
- Image object to save.
- Open SwitchParameter
- Open file after saving.
- Quality Int32
- Quality for JPEG or WEBP images.