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
Compression
Gets the compression type to use.
public TiffCompression? Compression { get; init; }
Property Value
CompressionLevel
Gets the compression level 1-9 for the deflate compression mode.
public DeflateCompressionLevel? CompressionLevel { get; init; }
Property Value
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
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
Methods
Encode<TPixel>(Image<TPixel>, Stream, CancellationToken)
Encodes the image to the specified stream from the Image<TPixel>.
protected override void Encode<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.
Type Parameters
TPixel
The pixel format.
Remarks
This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.