Skip to main content

Crate jixel

Crate jixel 

Source

Structs§

ColorEncoding
CICP-style color encoding: which primaries + transfer + rendering intent the original image was authored in. The white point is fixed by the primaries for the named enumerants (e.g. sRGB primaries imply D65), but JXL still carries it as a separate field, so we expose it.
EncodeConfig
FlMeta
Color / display metadata for the fast-lossless encoders.
GainMap
A gain map to attach to an encode via EncodeConfig::with_gain_map.
GainMapFloats
Floating-point gain map parameters, the convenient way to build an IsoGainMap. Per-channel arrays are [R, G, B]; pass three identical values for a single-channel (luminance) gain map.
IsoGainMap
Binary ISO 21496-1 gain map metadata.
JpegTranscodeConfig
Options for encode_jpeg_lossless_with_config.

Enums§

Arbiter
The perceptual metric whose preferences settle the lossy encoder’s decisions where metrics disagree. Ignored for lossless.
CodingTransform
The color transform lossy frames (VarDCT, or the lossy modular arm) are coded in.
ColorSpace
JXL ColorSpace enum (2 bits — direct, no U32Coder).
DecodingSpeed
Decode-speed/density tradeoff for lossless encoding. Ignored for lossy.
EncodeError
Errors that can occur during JXL encoding.
GainMapPixels
Sample storage of a gain map image.
Grain
Grain synthesis the decoder applies on top of a lossy VarDCT frame (see EncodeConfig::grain).
GroupOrder
Order in which a lossy VarDCT frame stores its groups. A progressive decoder renders groups as they arrive, so this is the order the image fills in. Costs a few bytes for the signaled permutation; the pixels are identical.
InkConvention
How CMYK samples express ink.
LossyModular
Which arm the lossy encoder uses. Besides VarDCT, jixel carries a lossy modular arm (quantized Squeeze pyramid): multi-resolution residual coding that outperforms block DCT on smooth/gradient-heavy content, most clearly from medium quality down.
Orientation
Primaries
JXL Primaries enum (U32Coder).
RenderingIntent
JXL RenderingIntent enum (U32Coder).
Speed
Encoder speed/density tradeoff, ordered from fastest to densest.
TransferFunction
JXL TransferFunction enum (U32Coder).
WhitePoint
JXL WhitePoint enum (U32Coder, 4 enumerants in the named range).

Traits§

BrotliCompression
Optional Brotli encoder used for metadata and JPEG reconstruction data.

Functions§

distance_from_quality
encode_fast_lossless
encode_fast_lossless_u16
Encode a high-bit-depth image (9..=16 bits).
encode_image
Encode interleaved 8-bit RGB samples. Lossy encoding interprets the samples using config.color_encoding; the default is sRGB.
encode_image_10bit
encode_image_12bit
encode_image_16bit
Encode a 16-bit RGB image. input is interleaved [R, G, B], width * height * 3 samples, each in 0..=65535.
encode_image_cmyk
Encode interleaved 8-bit CMYK samples. icc_profile must be a CMYK profile; it is embedded and is what decoders render the image with.
encode_image_cmyk_16bit
Encode interleaved CMYK samples of bits (10, 12 or 16) significant bits.
encode_image_f16
Encode a 16-bit-half float RGB image (lossy). Input is f32 in [0, 1]; the stream is declared as f16.
encode_image_f32
Encode a 32-bit float RGB image (lossy). input is interleaved [R, G, B], width * height * 3 samples encoded per config.color_encoding in [0, 1].
encode_image_gray
Encode an 8-bit grayscale image. input is width * height luma bytes. The codestream declares a Gray color space, so the decoder emits a single-channel (L) image. Internally the luma is run through the XYB pipeline with R=G=B; the chroma channels are ~constant and cost almost nothing.
encode_image_gray_10bit
Encode a 10-bit grayscale image. input is width * height luma samples (0..=1023).
encode_image_gray_12bit
Encode a 12-bit grayscale image. input is width * height luma samples (0..=4095).
encode_image_gray_16bit
Encode a 16-bit grayscale image. input is width * height luma samples (0..=65535).
encode_image_gray_alpha
encode_image_gray_alpha_10bit
Encode a 10-bit grayscale+alpha image. input is interleaved [L, A] pairs, width * height * 2 samples total, each in 0..=1023.
encode_image_gray_alpha_12bit
Encode a 12-bit grayscale+alpha image. input is interleaved [L, A] pairs, width * height * 2 samples total, each in 0..=4095.
encode_image_gray_alpha_16bit
Encode a 16-bit grayscale+alpha image. input is interleaved [L, A] pairs, width * height * 2 samples total, each in 0..=65535.
encode_image_gray_f16
Encode a 16-bit-half float grayscale image (lossy).
encode_image_gray_f32
Encode a 32-bit float grayscale image (lossy). input is width * height luma samples encoded per config.color_encoding in [0, 1].
encode_image_with_alpha
Encode interleaved 8-bit RGBA samples. Lossy RGB samples use config.color_encoding; alpha is linear opacity.
encode_image_with_alpha_10bit
encode_image_with_alpha_12bit
encode_image_with_alpha_16bit
Encode a 16-bit RGBA image. input is interleaved [R, G, B, A], width * height * 4 samples, each in 0..=65535.
encode_image_with_alpha_f16
Encode a 16-bit-half float RGBA image (lossy).
encode_image_with_alpha_f32
Encode a 32-bit float RGBA image (lossy). input is interleaved [R, G, B, A]; RGB uses config.color_encoding in [0, 1], A is linear opacity in [0, 1] (quantized to a 16-bit alpha channel).
encode_jpeg_lossless
Losslessly transcodes a JPEG file into JPEG XL, keeping the ability to reconstruct the original bytes.
encode_jpeg_lossless_with_config