PeachImage

PeachImage.Formats.Avif.AvifEncoderOptions

AvifEncoderOptions.Lossless Property

When true, encodes via AV1’s lossless coding path (Walsh-Hadamard transform, no quantization) instead of DCT_DCT, preserving every pixel exactly -- alpha, when present, is encoded losslessly too. Defaults to false.

For RGB24/Rgba32 sources, this also switches chroma from this encoder’s usual 4:2:0/BT.601 to 4:4:4 with AV1’s identity color matrix (Y=G, Cb=B, Cr=R, no cross-channel math at all – the same technique real lossless AVIF encoders, e.g. libavif/aom’s --lossless, use) so color detail isn’t discarded by subsampling before the lossless coding step ever runs. This is not a separate opt-in: a boolean named Lossless that silently kept subsampling chroma would defeat its own purpose, so setting this to true always means genuinely pixel-exact output for RGB24/Rgba32/Gray8 sources alike. Quality-based encoding is completely unaffected and always stays 4:2:0/BT.601.

public bool Lossless { get; init; }

Property Value

System.Boolean