ImageEn, unit iexBitmaps

TIEBitmap.ColorProfileMode

TIEBitmap.ColorProfileMode

Declaration

property ColorProfileMode: TIEColorProfileMode;

Description

Specifies how the ICC color profile (in some TIFF, JPEG, PNG or PSD files) is handled for the image.
Currently this is only used for ie24RGB and ieCMYK pixel format images.
Value Description
iecpIgnore If the image contains an ICC profile it is maintained, but not rendered or applied
iecpRender If the image contains an ICC profile (stored at ColorProfile) it is rendered when displayed (e.g. in TImageEnView), without modifying the image. If you enable this option, call TImageEnView.Update to display the changes
iecpApply If the image contains an ICC profile it is applied to the image (i.e the image is modified). This option is only effective if specified before loading the image

Note: For iecpRender, NativePixelFormat should be enabled

Default: iecpIgnore

Demo

Demo  Demos\Display\ColorProfiles\ColorProfiles.dpr

Examples

// Apply color profile on rendering (image is not modified, it only renders with the color profile)
ImageEnView1.IEBitmap.ColorProfileMode := iecpRender;
ImageEnView1.IO.NativePixelFormat := True;  // This means "Do not convert to RGB"
ImageEnView1.IO.LoadFromFile('cmyk-jpeg.jpg');

// Apply color profile to the image (image colors are changed, i.e. image is modified)
ImageEnView1.IEBitmap.ColorProfileMode := iecpApply;
ImageEnView1.IO.NativePixelFormat := False; // This means "Convert to RGB"
ImageEnView1.IO.LoadFromFile('cmyk-jpeg.jpg');

// Do not apply color profile (image is not modified, and is rendered without the color profile)
ImageEnView1.IEBitmap.ColorProfileMode := iecpIgnore;
ImageEnView1.IO.NativePixelFormat := False; // This means "Convert to RGB"
ImageEnView1.IO.LoadFromFile('cmyk-jpeg.jpg');


// Load a color profile to apply to the image if one is not available
ImageEnView1.IO.Params.DefaultICCProfile.LoadFromFile('C:\Windows\System32\spool\drivers\color\AdobeRGB1998.icc');
ImageEnView1.IEBitmap.ColorProfileMode := iecpApply;
ImageEnView1.IO.LoadFromFile('C:\input.tif');


// Load a TIFF containing a CMYK profile, save to JPEG maintaining the profile
ImageEnView1.IEBitmap.ColorProfileMode := iecpIgnore;   // or iecpRender
ImageEnView.IO.LoadFromFile('D:\Img with ICC Profile.tif');
ImageEnView1.IO.Params.JPEG_ColorSpace := ioJPEG_CMYK;
ImageEnView1.IO.SaveToFile('D:\Img with ICC Profile.jpeg');


// Render image with a custom color profile
ImageEnView1.IEBitmap.ColorProfile.LoadFromFile( 'D:\ColorProfile.icc' );
ImageEnView1.IEBitmap.ColorProfileMode := iecpRender;
ImageEnView1.Update();

See Also

ColorProfile
Color Management System

Compatibility Information

Prior to v15.1.0, Color profile support in ImageEn was handled by IEGlobalSettings().EnableCMS and IEGlobalSettings().ApplyColorProfileOnRendering. These properties should no longer be used.

IEGlobalSettings().EnableCMS (which defaulted to False) is still included for compatibility. Enabling EnableCMS will force ColorProfileMode := iecpApply. Rather than setting EnableCMS, you should use ImageEnView1.IEBitmap.ColorProfileMode := iecpApply; (before loading your image).
IEGlobalSettings().ApplyColorProfileOnRendering (which defaulted to True) has been removed. Rather than enabling ApplyColorProfileOnRendering, you should use ImageEnView1.IEBitmap.ColorProfileMode := iecpRender; or ImageEnView1.IEBitmap.ColorProfileMode := iecpIgnore;

Code that was:
IEGlobalSettings().EnableCMS := False;
IEGlobalSettings().ApplyColorProfileOnRendering := True;

Should now be:
ImageEnView1.IEBitmap.ColorProfileMode := iecpRender;

Code that was:
IEGlobalSettings().EnableCMS := True;
IEGlobalSettings().ApplyColorProfileOnRendering := False;  // or True

Should now be:
ImageEnView1.IEBitmap.ColorProfileMode := iecpApply;

Code that was:
IEGlobalSettings().EnableCMS := False;
IEGlobalSettings().ApplyColorProfileOnRendering := False;

Should now be:
ImageEnView1.IEBitmap.ColorProfileMode := iecpIgnore;