PeachImage
PeachImage.Formats.Jxl.JxlJpegRecompression
JxlJpegRecompression.RecompressJpeg Method
| Overloads | |
|---|---|
| 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. |
JxlJpegRecompression.RecompressJpeg(Stream) Method
Recompresses the JPEG file in stream into a JPEG XL file.
public static byte[] RecompressJpeg(System.IO.Stream stream);
Parameters
stream System.IO.Stream
A readable stream positioned at the start of the JPEG file. It is read to its end.
Returns
System.Byte[]
The bytes of the JPEG XL file.
Exceptions
JxlUnsupportedFeatureException
The data is not a JPEG, or it is one that cannot be recompressed losslessly.
JxlJpegRecompression.RecompressJpeg(Stream, int, TaskScheduler) Method
Recompresses the JPEG file in stream into a JPEG XL file, bounding the threads the call may use.
public static byte[] RecompressJpeg(System.IO.Stream stream, int maxDegreeOfParallelism, System.Threading.Tasks.TaskScheduler? taskScheduler=null);
Parameters
stream System.IO.Stream
A readable stream positioned at the start of the JPEG file. It is read to its end.
maxDegreeOfParallelism System.Int32
The most threads this call may use: -1 leaves it to the library (up to System.Environment.ProcessorCount), 1 runs on the calling thread. Per call, not global. Does not change the output.
taskScheduler System.Threading.Tasks.TaskScheduler
An optional scheduler for the parallel work, to share one limit across concurrent calls. null uses the thread pool.
Returns
System.Byte[]
The bytes of the JPEG XL file.
Exceptions
JxlUnsupportedFeatureException
The data is not a JPEG, or it is one that cannot be recompressed losslessly.
JxlJpegRecompression.RecompressJpeg(Stream, Stream) Method
Recompresses the JPEG file in source and writes the JPEG XL file to destination.
public static void RecompressJpeg(System.IO.Stream source, System.IO.Stream destination);
Parameters
source System.IO.Stream
destination System.IO.Stream
Exceptions
JxlUnsupportedFeatureException
The data is not a JPEG, or it is one that cannot be recompressed losslessly.
JxlJpegRecompression.RecompressJpeg(Stream, Stream, int, TaskScheduler) Method
Recompresses the JPEG file in source and writes the JPEG XL file to destination, bounding the threads the call may use.
public static void RecompressJpeg(System.IO.Stream source, System.IO.Stream destination, int maxDegreeOfParallelism, System.Threading.Tasks.TaskScheduler? taskScheduler=null);
Parameters
source System.IO.Stream
A readable stream positioned at the start of the file. It is read to its end.
destination System.IO.Stream
The stream the result is written to.
maxDegreeOfParallelism System.Int32
The most threads this call may use: -1 leaves it to the library (up to System.Environment.ProcessorCount), 1 runs on the calling thread. Per call, not global. Does not change the output.
taskScheduler System.Threading.Tasks.TaskScheduler
An optional scheduler for the parallel work, to share one limit across concurrent calls. null uses the thread pool.
Exceptions
JxlUnsupportedFeatureException
The data is not a JPEG, or it is one that cannot be recompressed losslessly.