Command
Save-Image
Saves an image to disk or returns its encoded bytes as a stream.
Syntax
Save-Image
[-AsStream]
[-CompressionLevel <Int32>]
[[-FilePath] <String>]
[-Image] <Image>
[-Open]
[-Quality <Int32>]
[<CommonParameters>]#Parameter set:
All Parameter SetsDescription
Use this cmdlet to persist an Image instance after applying transformations.
Examples
Overwrite the source file
Save-Image -Image $imgSave as JPEG with quality 80
Save-Image -Image $img -FilePath out.jpg -Quality 80Parameters
- -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.
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.