Table of Contents

Enum ChromaSubsampling

Namespace
Egami.Formats.Jpeg
Assembly
Egami.dll

How the chroma (Cb and Cr) components are sampled relative to luma.

public enum ChromaSubsampling

Fields

Subsample420 = 0

4:2:0: half the width and half the height. The usual choice for photos.

Subsample422 = 1

4:2:2: half the width, full height.

Subsample444 = 2

4:4:4: every pixel keeps its own chroma. Larger files; sharper colored edges and text.

Examples

using FileStream output = File.Create("duck-q85.jpg");
image.Save(output, JpegFormat.Info, new JpegWriterOptions
{
    Quality = 85,                                  // 75 by default, on libjpeg's scale
    Subsampling = ChromaSubsampling.Subsample444,  // 4:2:0 by default
    OptimizeHuffman = true,                        // a few percent smaller, a little slower
});