ImageEn, unit iexBitmaps

TIOParams.JPEG_Quality

TIOParams.JPEG_Quality


Declaration


property JPEG_Quality: integer;


Description


The quality factor for the current JPEG image. Range is 1 to 100, though typical range is 60 (low quality) to 95 (high quality).
Higher values will improve image quality but require more disk space.

Default: 80 (Specified by IOParamDefaults)

Note: This property is not stored in a JPEG image, so it is never set when loading an image. Instead you set it when saving a JPEG to specify your desired compression.
It is possible to estimate the original JPEG compression using IECalcJpegStreamQuality or IECalcJpegFileQuality.


Examples


// Load a JPEG and save it using the same compression quality
ImageEnView1.IO.LoadFromFile('C:\input.jpg');
ImageEnView1.IO.Params.JPEG_Quality := IECalcJpegFileQuality('C:\input.jpg');
ImageEnView1.IO.SaveToFile('D:\output.jpg');

// Convert a BMP to a JPEG at 90% quality
bmp := TIEBitmap.create;
bmp.ParamsEnabled := True;
bmp.Read( 'D:\input.bmp' );
bmp.Params.JPEG_Quality := 90;
bmp.Write( 'D:\output.jpg' );
bmp.Free;