Table of Contents

Enum ChromaDownsampling

Namespace
Egami
Assembly
Egami.dll

How chroma is reduced to the chroma resolution when a raster converts to a subsampled YuvRaster.

public enum ChromaDownsampling

Fields

Average = 0

Averages with the filter that matches the siting: a 2 × 2 box for centered chroma, a [1, 2, 1] filter across co-sited columns or rows. Edges repeat the last sample.

Fast = 1

Takes the chroma of the top-left pixel of each block, with no filter.

Examples

using Raster photo = Raster.Load("duck.png");

// The defaults filter chroma by its siting both ways; Nearest and Fast trade edge quality for speed.
YuvConvertOptions fast = new() { Upsampling = ChromaUpsampling.Nearest, Downsampling = ChromaDownsampling.Fast };
using YuvRaster<byte> yuv = YuvRaster.FromRaster(photo, ChromaFormat.Yuv420, YuvColor.Bt601Limited, options: fast);
using Raster<Rgba8> back = yuv.ToRaster<Rgba8>(fast);