Class JxlReaderOptions
Options for reading JPEG XL, on top of the general ReaderOptions.
public sealed record JxlReaderOptions : ReaderOptions, IEquatable<ReaderOptions>, IEquatable<JxlReaderOptions>
- Inheritance
-
JxlReaderOptions
- Implements
- Inherited Members
Examples
// An animation loads as its frames, blended onto the canvas, each with its delay.
using Raster animation = Raster.Load("sprite.jxl");
int frames = animation.FrameCount;
// The layers before blending, for an editor: each at its own size and place.
IReadOnlyList<JxlLayer> layers = JxlImage.ReadLayers("sprite.jxl");
foreach (JxlLayer layer in layers)
{
Console.WriteLine($"{layer.Raster.Width}x{layer.Raster.Height} at {layer.X},{layer.Y}: {layer.Blend}, {layer.Duration.TotalMilliseconds} ms");
layer.Dispose();
}
// The preview some files carry for quick display, or null.
using Raster? preview = JxlImage.ReadPreview("duck.jxl");
// A lossy still at an eighth of its size, from its LF image alone.
using Raster thumbnail = Raster.Load("duck.jxl", options: new JxlReaderOptions { MaxDownscale = 8 });
Properties
Default
Gets the default options.
public static JxlReaderOptions Default { get; }
Property Value
LinearOutput
Gets a value indicating whether to give linear light in single float, in the file's own primaries (sRGB's when its ICC profile has none), instead of the file's encoded color space. Off by default. CMYK files are not affected.
public bool LinearOutput { get; init; }
Property Value
MaxDownscale
Gets how much smaller than the image the decode may be. 8 or more decodes only the LF image of a lossy still, an eighth of the size each way and far faster; Modular, animated and layered files, and files with extra channels, decode in full. 1, the default, always decodes in full.
public int MaxDownscale { get; init; }
Property Value
RenderSpotColors
Gets a value indicating whether spot color channels are mixed into the color, as djxl does. On by default; off leaves the color as coded, and the spot channels can be read with ReadExtraChannel(string, int, ReaderOptions?, EgamiContext?).
public bool RenderSpotColors { get; init; }