Declaration
TIEICC = class;
Description
TIEICC class contains a color profile. It is used for loading an image ICC profile and for displaying the ICC profile (which is sRGB by default).
Note:
◼ICC profiles are supported for JPEG, TIFF, PNG and PSD files
◼Some constants are defined in the ielcms unit
// 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' );
// Apply InputICCProfile (AdobeRGB1998.icc) color profile to an image and output as OutputICCProfile (Defaults to sRGB)
// Note: This permanently changes the colors of the image
ImageEnView1.IO.LoadFromFile('C:\out.ppm');
ImageEnView1.IO.Params.InputICCProfile.LoadFromFile('C:\AdobeRGB1998.icc');
ImageEnView1.IO.Params.InputICCProfile.ConvertBitmap( ImageEnView1.IEBitmap, ie24RGB, ImageEnView1.IO.Params.OutputICCProfile );
// Load the color profile of the current monitor
icc := TIEICC.Create();
icc.LoadFromFile( IEGlobalSettings().CurrentMonitorProfile );
// Do something with icc
icc.Free();
// Display the meta-data for a color profile in TStringGrid
procedure TMainForm.UpdateICCDisplay(const Filename: string);
var
i: Integer;
icc: TIEICC;
begin
// Layout
StringGrid1.ColCount := 2;
StringGrid1.ColWidths[0] := StringGrid1.ClientWidth div 2;
StringGrid1.ColWidths[1] := StringGrid1.ClientWidth div 2;
// Captions
StringGrid1.Cells[0, 0] := 'Property';
StringGrid1.Cells[1, 0] := 'Value';
StringGrid1.Cells[0, 1] := 'Filename';
StringGrid1.Cells[0, 2] := 'Copyright';
StringGrid1.Cells[0, 3] := 'Description';
StringGrid1.Cells[0, 4] := 'InputColorSpace';
StringGrid1.Cells[0, 5] := 'OutputColorSpace';
// Reset values
for i := 1 to StringGrid1.RowCount - 1 do
StringGrid1.Cells[1, 1] := '';
if ( Uppercase( ExtractFileExt( Filename )) = '.ICC' ) or
( Uppercase( ExtractFileExt( Filename )) = '.ICM' ) then
begin
icc := TIEICC.Create();
try
icc.LoadFromFile( Filename );
StringGrid1.Cells[1, 1] := ExtractFileName( Filename );
StringGrid1.Cells[1, 2] := String( icc.Copyright );
StringGrid1.Cells[1, 3] := String( icc.Description );
StringGrid1.Cells[1, 4] := String( icc.InputColorSpace );
StringGrid1.Cells[1, 5] := String( icc.OutputColorSpace );
finally
icc.Free();
end;
end;
end;
Properties
Methods
See Also
◼Color Management System
◼InputICCProfile
◼DefaultICCProfile
◼OutputICCProfile
◼EnableCMS
◼ApplyColorProfileOnRendering
◼ColorProfile
◼CurrentMonitorProfile