ImageEn, unit iexBitmaps

TIOParams.IEN_Compression

TIOParams.IEN_Compression


Declaration

property IEN_Compression: TIOFileType;


Description

Specifies the format to save an ImageEn layer file.

If CompressionFormat is -1, a lossless zlib compression format is used (preserving pixel format and alpha channel).
If CompressionFormat is -2, a non-compressed format is used (preserving pixel format and alpha channel).
Otherwise any standard image format can be used, except ioTIFF.
If you offset a value by 10000, e.g. 10000 + ioPNG, then non-transparent layers (e.g. background/layer 0) will be JPEG format, and the remaining layers the specified format. This is useful if you want maximum compression but need to maintain transparency.

Notes:
- If your image layers use an alpha channel, ensure IEN_Compression is -1, -2 or ioPNG
- Even if a standard compression format, such as ioJPEG is used, the file will only be readable by ImageEn
- ioPNG should not be used if you need compatibility with ImageEn versions that use ieenWIC
- If ioJPEG compression is used, JPEG Quality is specified by IOParamDefaults (80, by default)

Default: -1


Examples

// Use PNG as the compression format
ImageEnView1.IO.Params.IEN_Compression := ioPNG;
ImageEnView1.IO.SaveToFileIEN('D:\Layers.ien');

// Use JPEG as the compression format (transparency will be lost)
ImageEnView1.IO.Params.IEN_Compression := ioJPEG;
IEGlobalSettings().IOParamDefaults.JPEG_Quality := 95;
ImageEnView1.IO.SaveToFileIEN('D:\Layers.ien');

// Use PNG as the compression format for layers with transparency, otherwise use JPEG
ImageEnView1.IO.Params.IEN_Compression := 10000 + ioPNG;
IEGlobalSettings().IOParamDefaults.JPEG_Quality := 95;
ImageEnView1.IO.SaveToFileIEN('D:\Layers.ien');

// Use internal compression format (transparency will be maintained)
ImageEnView1.IO.Params.IEN_Compression := -1;
ImageEnView1.IO.SaveToFileIEN('D:\Layers.ien');

// Use internal compression format for layers with transparency, otherwise use JPEG
ImageEnView1.IO.Params.IEN_Compression := 10000 + -1;
IEGlobalSettings().IOParamDefaults.JPEG_Quality := 95;
ImageEnView1.IO.SaveToFileIEN('D:\Layers.ien');