Class JpegEncoder
Encoder for writing the data image to a stream in jpeg format.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Formats.Jpeg
Assembly: SixLabors.ImageSharp.dll
Syntax
public sealed class JpegEncoder : ImageEncoder, IImageEncoder
Properties
| Improve this Doc View SourceColorType
Gets the jpeg color for encoding.
Declaration
public JpegEncodingColor? ColorType { get; set; }
Property Value
Type | Description |
---|---|
Nullable<JpegEncodingColor> |
Interleaved
Gets the component encoding mode.
Declaration
public bool? Interleaved { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Boolean> |
Remarks
Interleaved encoding mode encodes all color components in a single scan. Non-interleaved encoding mode encodes each color component in a separate scan.
Quality
Gets the quality, that will be used to encode the image. Quality
index must be between 1 and 100 (compression from max to min).
Defaults to
Declaration
public int? Quality { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Int32> |
Methods
| Improve this Doc View SourceEncode<TPixel>(Image<TPixel>, Stream, CancellationToken)
Encodes the image to the specified stream from the Image<TPixel>.
Declaration
protected override void Encode<TPixel>(Image<TPixel> image, Stream stream, CancellationToken cancellationToken)
where TPixel : struct, IPixel<TPixel>
Parameters
Type | Name | Description |
---|---|---|
Image<TPixel> | image | The Image<TPixel> to encode from. |
Stream | stream | The |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Type Parameters
Name | Description |
---|---|
TPixel | The pixel format. |
Overrides
SixLabors.ImageSharp.Formats.ImageEncoder.Encode<TPixel>(SixLabors.ImageSharp.Image<TPixel>, Stream, CancellationToken)
Remarks
This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.