Table of Contents

Interface IImageEncoder

Namespace
SixLabors.ImageSharp.Formats
Assembly
SixLabors.ImageSharp.dll

Defines the contract for all image encoders.

public interface IImageEncoder

Properties

SkipMetadata

Gets a value indicating whether to ignore decoded metadata when encoding.

bool SkipMetadata { get; init; }

Property Value

bool

Methods

EncodeAsync<TPixel>(Image<TPixel>, Stream, CancellationToken)

Encodes the image to the specified stream from the Image<TPixel>.

Task EncodeAsync<TPixel>(Image<TPixel> image, Stream stream, CancellationToken cancellationToken) where TPixel : unmanaged, IPixel<TPixel>

Parameters

image Image<TPixel>

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

Task

A Task representing the asynchronous operation.

Type Parameters

TPixel

The pixel format.

Encode<TPixel>(Image<TPixel>, Stream)

Encodes the image to the specified stream from the Image<TPixel>.

void Encode<TPixel>(Image<TPixel> image, Stream stream) where TPixel : unmanaged, IPixel<TPixel>

Parameters

image Image<TPixel>

The Image<TPixel> to encode from.

stream Stream

The Stream to encode the image data to.

Type Parameters

TPixel

The pixel format.