Using ICC Profile Functions

Show in webframe

The ICC Profile format is defined by the International Color Consortium (ICC). For background on the origination and purpose of this format, refer to http://www.color.org/.

Creating an ICC Profile

To create an ICC profile, start by create a new IccProfileExtended object. Within the IccProfileExtended class is an IccHeader structure that contains header information for the profile. Once the IccProfileExtended object has been initialized, it will contain an empty header but it can be initialized by calling the IccHeader constructor. It is also possible to define a new IccHeader structure and use the IccHeader.Empty property to sets the members of the IccHeader structure to their default values.

Tags

The ICC Profile can use tags. Tags can be inserted in an ICC profile, created but not inserted, or deleted. To insert a tag in an ICC profile, perform the following steps:

To create a tag without inserting it into an ICC profile, call the IccTools.CreateTagType method.

At anytime you can get a tag from an ICC profile by calling the IccProfileExtended.GetTagmethod. Delete a tag by calling the IccProfileExtended.DeleteTag method.

Tags are of various types. These types have a signature associated with them to identify them. Tags also have signatures associated with them. One or both of these signatures may be used when creating, inserting or deleting tags. To get the signature of a specific tag type, call the IccProfileExtended.GetTagTypeSignature method. For more information on tags, types and signatures, please refer to the documentation available through http://www.color.org/.

When working with ICC profiles, it may be necessary to convert values from one form to another. Variables of the type IccS15Fixed16ArrayTagType, or IccU16Fixed16ArrayTagType require data in a 2 bytes fixed, 2 bytes number form. The IccTools.FromDoubleTo2bFixed2bNumber method converts a double value into a 2 bytes fixed, 2 bytes number form, allowing the user to set these variables. The IccTools.From2bFixed2bNumberToDouble method converts a 2 bytes fixed, 2 bytes number value into a double value, allowing the user to get data from these variables.

Similarly, the type IccUint8ArrayTagType requires data in a 1 byte fixed, 1 byte number form. The IccTools.FromDoubleToU8Fixed8Number method converts a double value into a 1 byte fixed, 1 byte number form. The IccTools.FromU8Fixed8NumberToDouble method converts a 1 byte fixed, 1 byte number value into a double value.

The TagData structure will always contain the correct values, regardless of whether a new ICC profile is being created or an existing one is being modified. The Data array will not contain any values until a call to the IccProfileExtended.UpdateDataArray method is made. This method updates the Data array with the latest modifications. Please note however, that before calling any of the IccProfileExtended.GenerateIccFile or IccProfileExtended.WriteToImagemethods, make sure that the Size and Data members of the IccProfileExtended structure has the right data either by loading an ICC profile into them, or by calling the IccProfileExtended.UpdateDataArray method to generate them.

Loading an ICC Profile

ICC profiles can be saved to ICC files or embedded in image files and loaded at a later date. Before loading an existing ICC profile from a saved file. To load an ICC profile from an image file, call the IccProfileExtended.ReadFromImage method. . When using this method of loading a ICC profile into this structure, the data member will contain all the profile data in one block of memory, and the TagData array will contain only the tag's data in one block of memory.

Saving an ICC Profile

An ICC profile can be saved (or embedded), in a TIFF, GIF or JPEG image file by calling the IccProfileExtended.WriteToImage method. To save an ICC profile to an ICC profile file, call the IccProfileExtended.GenerateIccFile method.

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.