Command
Add-ImageText
Adds text to an image at the provided coordinates and writes the updated image to disk.
Syntax
Add-ImageText
[-Color <Color>]
[-FilePath] <String>
[-FontFamily <String>]
[-FontSize <Single>]
[-OutlineColor <Color>]
[-OutlineWidth <Single>]
[-OutputPath] <String>
[-ShadowColor <Color>]
[-ShadowOffsetX <Single>]
[-ShadowOffsetY <Single>]
[-Text] <String>
[-X] <Single>
[-Y] <Single>
[<CommonParameters>]#Parameter set:
All Parameter SetsExamples
Add watermark text
Add-ImageText -FilePath in.png -OutputPath out.png -Text "Sample" -X 10 -Y 10Draw text using ImageSharp
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.ColorSpaces;
using var img = Image.Load("in.png");
img.AddText(10, 10, "Sample", Color.Black, 24);
img.Save("out.png");Parameters
- -Color Color
- Text color.
- -FilePath String
- Source image path.
- -FontFamily String
- Font family.
- -FontSize Single
- Font size.
- -OutlineColor Color
- Outline color.
- -OutlineWidth Single
- Outline width.
- -OutputPath String
- Destination image path.
- -ShadowColor Color
- Color of shadow.
- -ShadowOffsetX Single
- X offset for shadow.
- -ShadowOffsetY Single
- Y offset for shadow.
- -Text String
- Text to add.
- -X Single
- X coordinate.
- -Y Single
- Y coordinate.
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.