ImageEn, unit iesettings

TIEGlobalSettings.AutoOptimizeOnSave

TIEGlobalSettings.AutoOptimizeOnSave


Declaration

property AutoOptimizeOnSave: Boolean;


Description

When enabled and saving an image with an AlphaChannel the non-visible areas of the image (where the alpha of the pixels is 0) will be set to white.
This can significantly reduce the size of saved images (if there are large areas of transparency), and prevents issues where seemingly hidden content is accessible in saved images.

Note:
This option will MODIFY the image if it contains an alpha channel (content in the non-visible area will be cleared)
This method is the same as calling SyncAlphaChannel (with ClearHiddenContent enabled)
It applies when saving to PNG, PSD, 32bit BMP, JPEG2000 (ioJ2000_RGB color space), WebP and WIC
Other optimization methods may be applied to this option in future

Default: False


Examples

// Save a PNG to the smallest possible file (by removing content that is not visible)
IEGlobalSettings().AutoOptimizeOnSave := True;
ImageEnView.IO.SaveToFile('output.png');