Table of Contents

Enum JxlExtraChannelKind

Namespace
Egami.Formats.Jxl
Assembly
Egami.dll

What a JPEG XL extra channel holds (B.3, ExtraChannelInfo).

public enum JxlExtraChannelKind

Fields

Alpha = 0

Alpha (opacity).

Black = 4

The black (K) of a CMYK image.

ColorFilterArray = 5

A color filter array (Bayer) channel.

Depth = 1

Depth.

NonOptional = 15

Data an application needs to show the image correctly.

Optional = 16

Data an application may ignore.

SelectionMask = 3

A selection mask.

SpotColor = 2

A spot color: ink coverage of the color in SpotColor.

Thermal = 6

Thermal (infrared) intensity.

Examples

// Alpha joins the pixels (straight, even when the file premultiplies); other extra channels are listed in the details.
using Raster image = Raster.Load("sprite.jxl");
JxlDetails details = (JxlDetails)image.Metadata.FormatDetails!;
foreach (JxlExtraChannel channel in details.ExtraChannels)
{
    Console.WriteLine($"{channel.Kind} '{channel.Name}', {channel.BitsPerSample} bits");
}

// Any one of them alone, such as depth or a selection mask, as gray floats.
using Raster<GrayF32> alpha = JxlImage.ReadExtraChannel("sprite.jxl", 0);

// Spot colors are mixed into the color as djxl does, unless turned off.
using Raster plain = Raster.Load("sprite.jxl", options: new JxlReaderOptions { RenderSpotColors = false });