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
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
StreamThe Stream to encode the image data to.
cancellationToken
CancellationTokenThe token to monitor for cancellation requests.
Returns
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
StreamThe Stream to encode the image data to.
Type Parameters
TPixel
The pixel format.