Enum JxlExtraChannelKind
What a JPEG XL extra channel holds (B.3, ExtraChannelInfo).
public enum JxlExtraChannelKind
Fields
Alpha = 0Alpha (opacity).
Black = 4The black (K) of a CMYK image.
ColorFilterArray = 5A color filter array (Bayer) channel.
Depth = 1Depth.
NonOptional = 15Data an application needs to show the image correctly.
Optional = 16Data an application may ignore.
SelectionMask = 3A selection mask.
SpotColor = 2A spot color: ink coverage of the color in SpotColor.
Thermal = 6Thermal (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 });