PeachImage

PeachImage.Formats.Jxl

JxlJpegRecompression Class

Losslessly recompresses a JPEG file into JPEG XL, the way cjxl does for JPEG input: the quantized DCT coefficients are re-coded with JPEG XL’s entropy coder (typically a fifth smaller than the JPEG) and the information needed to write the original bytes back is kept in the file, so JxlJpegReconstruction gives the JPEG back unchanged. The result also decodes like any JPEG XL image, to the pixels the JPEG decodes to.

public static class JxlJpegRecompression

Inheritance System.Object → JxlJpegRecompression

Remarks

Baseline (sequential Huffman, 8-bit) JPEGs with one component or with Y, Cb and Cr components are supported, with 4:4:4, 4:2:2, 4:4:0 or 4:2:0 sampling, restart intervals and any metadata markers. Progressive, arithmetic-coded, 12-bit and CMYK JPEGs are not; use Load(Stream, DecoderOptions) and Save(Stream, string, EncoderOptions) to turn those into (lossy or lossless) JPEG XL images instead. Recompression reads the whole file.

Methods  
RecompressJpeg(Stream) Recompresses the JPEG file in stream into a JPEG XL file.
RecompressJpeg(Stream, int, TaskScheduler) Recompresses the JPEG file in stream into a JPEG XL file, bounding the threads the call may use.
RecompressJpeg(Stream, Stream) Recompresses the JPEG file in source and writes the JPEG XL file to destination.
RecompressJpeg(Stream, Stream, int, TaskScheduler) Recompresses the JPEG file in source and writes the JPEG XL file to destination, bounding the threads the call may use.
TryRecompressJpeg(Stream, byte[]) Recompresses the JPEG file in stream if it can be recompressed losslessly. Returns false (without throwing) for data that is not a JPEG or uses features that cannot be reproduced.
TryRecompressJpeg(Stream, int, TaskScheduler, byte[]) Like TryRecompressJpeg(Stream, byte[]), bounding the threads the call may use.