Enum ExrCompression
How an OpenEXR part's pixel data is compressed.
public enum ExrCompression
Fields
B44 = 6Half samples in fixed 4 × 4 blocks of 14 bytes, 32 scanlines a block. Lossy.
B44A = 7B44, with flat blocks stored in 3 bytes. Lossy.
Dwaa = 8DreamWorks' DCT compression, 32 scanlines a block. Lossy.
Dwab = 9DreamWorks' DCT compression, 256 scanlines a block. Lossy.
Htj2k256 = 11High-throughput JPEG 2000 at 256 scanlines a block, new in OpenEXR 3.4. Egami reads the header but not the pixels.
Htj2k32 = 12High-throughput JPEG 2000 at 32 scanlines a block, new in OpenEXR 3.4. Egami reads the header but not the pixels.
None = 0Not compressed.
Piz = 4A Haar wavelet and Huffman coding, 32 scanlines a block. Lossless; good on grainy photographs.
Pxr24 = 5Float samples rounded to 24 bits, then deflated, 16 scanlines a block. Lossy for float, lossless for half and uint.
Rle = 1Run-length encoding of byte differences, one scanline a block. Lossless.
Zip = 3Deflate of byte differences, 16 scanlines a block. Lossless.
Zips = 2Deflate of byte differences, one scanline a block. Lossless.
Zstd = 10Zstandard, new in OpenEXR 3.4. Egami reads the header but not the pixels.
Examples
// Half-float RGBA, ZIP-compressed, by default; a sRGB or other non-linear raster is linearized first.
beauty.Save("copy.exr");
beauty.Save("float.exr", new ExrWriterOptions { Compression = ExrCompression.Piz, PixelType = ExrPixelType.Float });