Enum Jpeg2000ColorSpace
The color space a JPEG 2000 file declares.
public enum Jpeg2000ColorSpace
Fields
CieLab = 5CIELab (JPX enumerated 14), converted to sRGB.
Cmyk = 4CMYK (JPX enumerated 12).
Gray = 2Grayscale (enumerated 17).
Icc = 6An ICC profile, kept in IccProfile.
Other = 7Another JPX enumerated space, read as its components say; EnumeratedColorSpace names it.
Srgb = 1sRGB (enumerated 16).
Sycc = 3sYCC (enumerated 18), converted to RGB.
Unspecified = 0None: a raw codestream, or a JP2 file whose colour specification Egami does not read.
Examples
using Raster image = Raster.Load("photo.jp2");
var details = (Jpeg2000Details)image.Metadata.FormatDetails!;
Console.WriteLine($"{details.Container}, {(details.Reversible ? "lossless 5/3" : "lossy 9/7")}, {details.DecompositionLevels} levels");
Console.WriteLine($"{details.QualityLayers} layers in {details.ProgressionOrder} order, {details.TileCount} tiles, {details.ColorSpace}");
foreach (Jpeg2000Component component in details.Components)
{
Console.WriteLine($"{component.Precision} bits{(component.IsSigned ? " signed" : "")}, sampled every {component.SubsamplingX}×{component.SubsamplingY}");
}
foreach (Jpeg2000Channel channel in details.Channels)
{
Console.WriteLine($"Channel {channel.Channel}: {channel.Type} for color {channel.Association}");
}