Table of Contents

Class TiffEncoder

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

Encoder for writing the data image to a stream in TIFF format.

public class TiffEncoder : QuantizingImageEncoder, IImageEncoder
Inheritance
TiffEncoder
Implements
Inherited Members

Constructors

TiffEncoder()

Initializes a new instance of the TiffEncoder class.

public TiffEncoder()

Properties

BitsPerPixel

Gets the number of bits per pixel.

public TiffBitsPerPixel? BitsPerPixel { get; init; }

Property Value

TiffBitsPerPixel?

Compression

Gets the compression type to use.

public TiffCompression? Compression { get; init; }

Property Value

TiffCompression?

CompressionLevel

Gets the compression level 1-9 for the deflate compression mode. Defaults to DefaultCompression.

public DeflateCompressionLevel? CompressionLevel { get; init; }

Property Value

DeflateCompressionLevel?

HorizontalPredictor

Gets a value indicating which horizontal prediction to use. This can improve the compression ratio with deflate or lzw compression.

public TiffPredictor? HorizontalPredictor { get; init; }

Property Value

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.

public TiffPhotometricInterpretation? PhotometricInterpretation { get; init; }

Property Value

TiffPhotometricInterpretation?

Methods

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

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

Parameters

image Image<TPixel>
stream Stream
cancellationToken CancellationToken

Type Parameters

TPixel