Table of Contents

Enum ChromaUpsampling

Namespace
Egami
Assembly
Egami.dll

How chroma is brought up to luma resolution when a YuvRaster converts to RGB.

public enum ChromaUpsampling

Fields

Bilinear = 0

Interpolates between neighboring chroma samples, honoring the siting: the 3:1 triangle filter JPEG and WebP decoders use for centered chroma, and the average of the two neighbors between co-sited samples.

Nearest = 1

Repeats each chroma sample over the luma samples it covers. Faster, with visible color fringes on edges.

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);