Class TiffEncoder
Encoder for writing the data image to a stream in TIFF format.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Formats.Tiff
Assembly: SixLabors.ImageSharp.dll
Syntax
public class TiffEncoder : QuantizingImageEncoder, IImageEncoder
Constructors
| Edit this page View SourceTiffEncoder()
Initializes a new instance of the TiffEncoder class.
Declaration
public TiffEncoder()
Properties
| Edit this page View SourceBitsPerPixel
Gets the number of bits per pixel.
Declaration
public TiffBitsPerPixel? BitsPerPixel { get; init; }
Property Value
Type | Description |
---|---|
TiffBitsPerPixel? |
Compression
Gets the compression type to use.
Declaration
public TiffCompression? Compression { get; init; }
Property Value
Type | Description |
---|---|
TiffCompression? |
CompressionLevel
Gets the compression level 1-9 for the deflate compression mode.
Declaration
public DeflateCompressionLevel? CompressionLevel { get; init; }
Property Value
Type | Description |
---|---|
DeflateCompressionLevel? |
HorizontalPredictor
Gets a value indicating which horizontal prediction to use. This can improve the compression ratio with deflate or lzw compression.
Declaration
public TiffPredictor? HorizontalPredictor { get; init; }
Property Value
Type | Description |
---|---|
TiffPredictor? |
PhotometricInterpretation
Gets the PhotometricInterpretation to use. Possible options are RGB, RGB with a color palette, gray or BiColor. If no PhotometricInterpretation is specified or it is unsupported by the encoder, RGB will be used.
Declaration
public TiffPhotometricInterpretation? PhotometricInterpretation { get; init; }
Property Value
Type | Description |
---|---|
TiffPhotometricInterpretation? |
Methods
| Edit this page 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 : 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. |
Type Parameters
Name | Description |
---|---|
TPixel | The pixel format. |
Overrides
Remarks
This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.