-
I'm loading ImageSharp into PowerShell so I can write some drawing automation. I want to create images completely from scratch, with a gradient background, and some text overlaid. According to the documentation, you can create a fresh image with this (translated from C#): $Image = [SixLabors.ImageSharp.Image[SixLabors.ImageSharp.PixelFormats.Rgba32]]::new(1024, 1024) Then, in the documentation for Image image = ...; // create any way you like.
Star star = new(x: 100.0f, y: 100.0f, prongs: 5, innerRadii: 20.0f, outerRadii:30.0f);
image.Mutate( x=> x.Fill(Color.Red, star)); // fill the star with red But there is no PS /> $Image | Get-Member
TypeName: SixLabors.ImageSharp.Image`1[[SixLabors.ImageSharp.PixelFormats.Rgba32, SixLabors.ImageSharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13]]
Name MemberType Definition
---- ---------- ----------
Clone Method SixLabors.ImageSharp.Image[SixLabors.ImageSharp.PixelFormats.Rgba32] Clone(), SixLabors.ImageSharp.Image[SixLabors.ImageSharp.PixelFormats.Rgba32] Clone(SixLabors.ImageSharp.Configuration configuration)
CloneAs Method SixLabors.ImageSharp.Image[TPixel2] CloneAs[TPixel2](SixLabors.ImageSharp.Configuration configuration), SixLabors.ImageSharp.Image[TPixel2] CloneAs[TPixel2]()
CopyPixelDataTo Method void CopyPixelDataTo(System.Span[SixLabors.ImageSharp.PixelFormats.Rgba32] destination), void CopyPixelDataTo(System.Span[byte] destination)
DangerousTryGetSinglePixelMemory Method bool DangerousTryGetSinglePixelMemory([ref] System.Memory[SixLabors.ImageSharp.PixelFormats.Rgba32] memory)
Dispose Method void Dispose(), void IDisposable.Dispose()
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ProcessPixelRows Method void ProcessPixelRows(SixLabors.ImageSharp.PixelAccessorAction[SixLabors.ImageSharp.PixelFormats.Rgba32] processPixels), void ProcessPixelRows[TPixel2](SixLabors.ImageSharp.Image[TPixel2] image2, SixLabors.ImageSharp.PixelAccessorAction[SixLabors.ImageSharp.PixelFormats.Rgba32,TPixel2]…
Save Method void Save(System.IO.Stream stream, SixLabors.ImageSharp.Formats.IImageEncoder encoder)
SaveAsync Method System.Threading.Tasks.Task SaveAsync(System.IO.Stream stream, SixLabors.ImageSharp.Formats.IImageEncoder encoder, System.Threading.CancellationToken cancellationToken = default)
ToString Method string ToString()
Item ParameterizedProperty SixLabors.ImageSharp.PixelFormats.Rgba32 Item(int x, int y) {get;set;}
Bounds Property SixLabors.ImageSharp.Rectangle Bounds {get;}
Configuration Property SixLabors.ImageSharp.Configuration Configuration {get;}
Frames Property SixLabors.ImageSharp.ImageFrameCollection[SixLabors.ImageSharp.PixelFormats.Rgba32] Frames {get;}
Height Property int Height {get;}
Metadata Property SixLabors.ImageSharp.Metadata.ImageMetadata Metadata {get;}
PixelType Property SixLabors.ImageSharp.Formats.PixelTypeInfo PixelType {get;}
Size Property SixLabors.ImageSharp.Size Size {get;}
Width Property int Width {get;} If you try to call
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The ImageSharp APIs are primarily built as as extension methods on top of Image The I'm afraid to say our API is optimised for C# and extensibility (hence all the extension methods) so using them directly in powershell is likely to be a bit of a mess so good luck and I hope you manage to wire something together that doesn't end up too ugly. |
Beta Was this translation helpful? Give feedback.
The ImageSharp APIs are primarily built as as extension methods on top of Image
The
Mutate
andClone
APIs are actaully in SixLabors.ImageSharp.Processing.ProcessingExtensions then a lot of the high level operations (Resize, Rotate etc) that are applied to theIImageProcessingContext
are also extension methods in the same namespace.I'm afraid to say our API is optimised for C# and extensibility (hence all the extension methods) so using them directly in powershell is likely to be a bit of a mess so good luck and I hope you manage to wire something together that doesn't end up too ugly.