Convert RasterImage to JPEG
Sample Code (convert single frame image to JPEG):
ConvertHandler.Convert("input.png", @"output.jpeg");
Sample Code (convert multi-frame image to JPEG):
RasterImage img = new RasterImage("input.tiff");
img.Save(@"output.jpeg");
When you convert image to JPEG image file using XImage.Raster C# Imaging library, you can customize and apply the following JPEG image options
- Progressive if save jpeg file in progressed format. Turn on it if there is a slow internet connection.
- OptimizedHuffman if use the optimized Huffman codes during encoding instead of using default Huffman codes
- SaveToGray if save the output jpeg file to gray
- ColorSpace set the output jpeg file's color space
- Quality set compression level
- SubSampleType specify sub sample type for jpeg encoder, use default compress quality 85
- SmoothImage if smooth the output jpeg file