QoiEncoder Class

Immutable settings for QOI encoding (lossless 8-bit RGB and RGBA still images).

public sealed class QoiEncoder : ImageEncoder

Remarks

The output is lossless for 8-bit pixels: every sample is preserved, including the colors of fully transparent pixels. Pixel formats with alpha are written with 4 channels (RGBA), the others with 3 (RGB). Gray pixel formats are written as RGB (R = G = B, decoded as RGB), and 16-bit pixel formats require QoiEncoder.AllowBitDepthReduction.

QOI stores exactly one frame: animated images and images with a poster frame are rejected with an UnsupportedImageFeatureException; use ImageFrame.Save to save one frame explicitly.

The header colorspace field is written from ImageMetadata.TransferFunction: 0 (sRGB with linear alpha) or 1 (linear). QOI stores no other metadata: an ICC profile, EXIF, XMP, an orientation other than ExifOrientation.TopLeft, a resolution or text entries follow ImageEncoder.MetadataHandling (rejected by default). MetadataHandling.Strip writes colorspace 0.

Inheritance
ImageEncoder QoiEncoder

Constructors

NameDescription
QoiEncoder()

QoiEncoder()

public QoiEncoder()

No documentation is available.

Properties

NameDescription
AllowBitDepthReductionGets a value indicating whether 16-bit pixel formats may be reduced to 8 bits per component (nearest rounding). Defaults to false.
FormatGets the format produced by this encoder.

AllowBitDepthReduction

QoiEncoder.cs

Gets a value indicating whether 16-bit pixel formats may be reduced to 8 bits per component (nearest rounding). Defaults to false.

public bool AllowBitDepthReduction { get; init; }

Property value

bool

Gets the format produced by this encoder.

public override ImageFormat Format { get; }

Property value

ImageFormat