PeachImage
PeachImage.ImageInfo
ImageInfo.IsLosslessEncoding Property
Whether the source’s pixel data was encoded losslessly by its original codec, so a caller can avoid silently re-encoding an already-lossy source under a full-fidelity assumption. Semantics are format-specific:
- WebP: true for a VP8L (lossless) bitstream, false for VP8
(lossy). Always false for an animated WebP — lossy/lossless is genuinely a
per-frame (
ANMF) property there, so a single file-level answer isn’t well-defined. - AVIF: true only when every AV1 tile’s frame header reports the coded stream as fully lossless (identity-transform, qindex/delta-q all zero, and no superres upscaling) — AND’d across every tile of a HEIF grid composite. A malformed AV1 tile bitstream degrades this to false rather than throwing, matching Identify(Stream)’s “header-level info only” leniency elsewhere.
- TIFF: true when the Compression tag is 1 (none), 5 (LZW), or 32773 (PackBits) — this decoder’s entire supported compression set, which is lossless by construction, so this is always true for any TIFF that decodes successfully today.
- Always false for every other format, including JPEG (always lossy) and PNG/BMP/GIF (not format-specific here since they have no lossy mode at all — see the general opaque-source handling elsewhere rather than this flag).
public bool IsLosslessEncoding { get; init; }