ImageEn includes a Color Management System (CMS) which enables the rendering of an image with its original colors.
To enable the CMS use:
IEGlobalSettings().EnableCMS := True;
To use LCMS instead of Windows CMS, set the following define within ie.inc and then recompile your packages.
{$define IEIncludeCMS}
When the CMS is enabled loading of images with a color profile will be slower.
If you don't define IEIncludeCMS in ie.inc then only the Windows CMS will be used. Note that Windows CMS is quicker than LCMS.
// Apply color profile on rendering
IEGlobalSettings().ApplyColorProfileOnRendering := True; // not actually necessary, this is the default
ImageEnView1.IO.NativePixelFormat := True; // This means "Do not convert to RGB"
ImageEnView1.IO.LoadFromFile('cmyk-jpeg.jpg');
// Apply color profile before rendering
IEGlobalSettings().EnableCMS := True;
IEGlobalSettings().ApplyColorProfileOnRendering := False;
ImageEnView1.IO.NativePixelFormat := False; // This means "Convert to RGB"
ImageEnView1.IO.LoadFromFile('cmyk-jpeg.jpg');
// Do not apply color profile
IEGlobalSettings().EnableCMS := False;
IEGlobalSettings().ApplyColorProfileOnRendering := False;
ImageEnView1.IO.NativePixelFormat := False; // This means "Convert to RGB"
ImageEnView1.IO.LoadFromFile('cmyk-jpeg.jpg');
// Load a TIFF containing a CMYK profile, save to JPEG maintaining the profile
IEGlobalSettings().EnableCMS := False;
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');
// Load image and apply a color profile
ImageEnView1.IO.Params.DefaultICCProfile.LoadFromFile('C:\Windows\System32\spool\drivers\color\AdobeRGB1998.icc');
ImageEnView1.IO.LoadFromFile('C:\input.tif');
// Save a JPEG with the ICC profile, sRGB2014.icc
ImageEnView1.IO.LoadFromFile( 'D:\201849018_A1.jpg' );
ImageEnView1.IO.params.InputICCProfile.LoadFromFile('D:\sRGB2014.icc');
ImageEnView1.IO.SaveToFile( 'D:\Test_SRGB.jpg' );
See Also
◼TIEICC
◼InputICCProfile
◼DefaultICCProfile
◼OutputICCProfile
◼EnableCMS
◼ApplyColorProfileOnRendering
◼ColorProfile
Attribution
ImageEn includes parts of Little cms by Marti Maria:
COPYRIGHT NOTICE OF LCMS
Little cms
Copyright (c) 1998-2004 Marti Maria
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.