JpegXlBlendMode Enum

How a layer of a JPEG XL image (JpegXlLayer) is combined with the layers below it: the blend modes of the format (ISO/IEC 18181-1, section F.2). The color channels and the alpha channel use the same mode.

public enum JpegXlBlendMode

Remarks

A decoder blends samples as numbers from 0 to 1 (1 being the largest value of the bit depth) in the color space of the image, and rounds the result to the bit depth; the result is clamped to the range of the samples. The modes that weight by alpha use the alpha channel of the image: in an image without alpha, JpegXlBlendMode.Blend replaces and JpegXlBlendMode.AlphaWeightedAdd adds.

Fields

NameValueDescription
Replace0The layer replaces the pixels below it, its alpha included: result = layer.
Add1The samples of the layer, alpha included, are added to the ones below it: result = below + layer.
Blend2The layer is drawn over the pixels below it, weighted by its alpha (the "over" operator of straight alpha): alpha = layerAlpha + belowAlpha * (1 - layerAlpha), and each color the weighted mean of the two colors.
AlphaWeightedAdd3The colors of the layer, multiplied by its alpha, are added to the ones below it: result = below + layer * layerAlpha. The alpha below is kept.
Multiply4The samples, alpha included, are multiplied by those of the layer: result = below * layer.