Table of Contents

Enum TiffCompression

Namespace
Egami.Formats.Tiff
Assembly
Egami.dll

A TIFF compression scheme, by its code in the Compression tag.

public enum TiffCompression

Fields

AdobeDeflate = 32946

Deflate under its older private code (32946); read only, written as Deflate.

CcittGroup3 = 3

CCITT Group 3 fax, T.4 (3); 1-bit images only.

CcittGroup4 = 4

CCITT Group 4 fax, T.6 (4); 1-bit images only.

CcittRle = 2

CCITT modified Huffman run lengths (2); read only.

CcittRleWord = 32771

CCITT run lengths on 16-bit words (32771); read only.

Deflate = 8

Deflate (8), the zlib format.

DngJpegXl = 52546

JPEG XL under DNG 1.7's code (52546), for previews and other pages that are not camera RAW; read only.

Jpeg = 7

JPEG as Adobe's TIFF Technical Note 2 describes it (7).

JpegXl = 50002

JPEG XL (50002), each strip or tile a JPEG XL codestream or file; read only.

Lzma = 34925

LZMA (34925), each strip or tile an xz stream of LZMA2, as libtiff writes; written at LzmaPreset.

Lzw = 5

LZW (5).

None = 1

No compression (1).

OldJpeg = 6

Old-style JPEG from TIFF 6.0 (6); read only, best effort.

PackBits = 32773

PackBits (32773).

SgiLog = 34676

SGILog, LogL and LogLuv high dynamic range (34676); read only.

SgiLog24 = 34677

SGILog24, LogLuv in 24 bits (34677); read only.

ThunderScan = 32809

ThunderScan 4-bit gray (32809); read only.

Webp = 50001

WebP (50001).

Zstd = 50000

Zstandard (50000), libtiff's code; written at ZstdLevel.

Examples

// Each pixel type is written at its own depth: 16-bit color stays 16-bit. Deflate with the predictor is the default.
photo.Save("duck.tif");

// Tiles, LZW, BigTIFF, or the smallest exact form the pixels allow.
photo.Save("tiled.tif", new TiffWriterOptions { Compression = TiffCompression.Lzw, TileSize = 256, Layout = TiffLayout.Auto });
photo.Save("small.tif", new TiffWriterOptions { Reduce = true });

// JPEG inside TIFF: RGB is written as YCbCr 4:2:0 with the tables shared by every strip.
photo.Save("photo.tif", new TiffWriterOptions { Compression = TiffCompression.Jpeg, Quality = 90 });