Interface IImageEncoder
Defines the contract for all image encoders.
Namespace: SixLabors.ImageSharp.Formats
Assembly: SixLabors.ImageSharp.dll
Syntax
public interface IImageEncoder
  Properties
| Edit this page View SourceSkipMetadata
Gets a value indicating whether to ignore decoded metadata when encoding.
Declaration
bool SkipMetadata { get; init; }
  Property Value
| Type | Description | 
|---|---|
| bool | 
Methods
| Edit this page View SourceEncodeAsync<TPixel>(Image<TPixel>, Stream, CancellationToken)
Encodes the image to the specified stream from the Image<TPixel>.
Declaration
Task EncodeAsync<TPixel>(Image<TPixel> image, Stream stream, CancellationToken cancellationToken) where TPixel : unmanaged, IPixel<TPixel>
  Parameters
| Type | Name | Description | 
|---|---|---|
| Image<TPixel> | image | The Image<TPixel> to encode from.  | 
      
| Stream | stream | The Stream to encode the image data to.  | 
      
| CancellationToken | cancellationToken | The token to monitor for cancellation requests.  | 
      
Returns
| Type | Description | 
|---|---|
| Task | A Task representing the asynchronous operation.  | 
      
Type Parameters
| Name | Description | 
|---|---|
| TPixel | The pixel format.  | 
      
Encode<TPixel>(Image<TPixel>, Stream)
Encodes the image to the specified stream from the Image<TPixel>.
Declaration
void Encode<TPixel>(Image<TPixel> image, Stream stream) where TPixel : unmanaged, IPixel<TPixel>
  Parameters
| Type | Name | Description | 
|---|---|---|
| Image<TPixel> | image | The Image<TPixel> to encode from.  | 
      
| Stream | stream | The Stream to encode the image data to.  | 
      
Type Parameters
| Name | Description | 
|---|---|
| TPixel | The pixel format.  |