ImageEn, unit iexBitmaps

TIEColorProfileMode

TIEColorProfileMode

Declaration

TIEColorProfileMode = (iecpIgnore, iecpRender, iecpApply);

Description

Specifies how the ICC color profile is handled for the image
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

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
NativePixelFormat
InputICCProfile