Meet us at PRINT 19. Chicago, IL. Oct. 3 - 5.
This documentation is for the old version. Go to the latest Graphics Mill docs

Loading and Saving Files with ICC Profiles

Most of image formats allows storing an ICC profile inside the image file (JPEG, TIFF, PSD, etc). When Graphics Mill for .NET loads such files, it also load this profile. When you save file to these formats, Graphics Mill for .NET saves the profile with the file (if available).

After profile is loaded into the bitmap, you can use ColorProfile property of the Bitmap. This code example demonstrates this:

Visual Basic
Dim bitmap As New Aurigma.GraphicsMill.Bitmap
'Choose LittleCMS color management engine
bitmap.ColorManagement.ColorManagementEngine = Aurigma.GraphicsMill.Transforms.ColorManagementEngine.LittleCms

'Load CMYK image with embedded ICC profile from file
bitmap.Load("C:\Horses.jpg")

'Display location of the embedded profile
System.Windows.Forms.MessageBox.Show("ICC Profile is located here:" & vbNewLine & _
  bitmap.ColorProfile.FileName)
C#
Aurigma.GraphicsMill.Bitmap bitmap = 
    new Aurigma.GraphicsMill.Bitmap();
//Choose LittleCMS color management engine
bitmap.ColorManagement.ColorManagementEngine = Aurigma.GraphicsMill.Transforms.ColorManagementEngine.LittleCms;

//Load CMYK image with embedded ICC profile from file
bitmap.Load(@"C:\Horses.jpg");

//Display location of the embedded profile
System.Windows.Forms.MessageBox.Show("ICC Profile is located here:" + 
    Environment.NewLine + bitmap.ColorProfile.FileName);

ColorProfile property can be also used to embed another profile into the image:

Visual Basic
Dim bitmap As New Aurigma.GraphicsMill.Bitmap
'Choose LittleCMS color management engine
bitmap.ColorManagement.ColorManagementEngine = Aurigma.GraphicsMill.Transforms.ColorManagementEngine.LittleCms

'Load CMYK image with embedded ICC profile from file
bitmap.Load("C:\Horses.jpg")

'Display location of the embedded profile
System.Windows.Forms.MessageBox.Show("ICC Profile is located here:" & vbNewLine & _
  bitmap.ColorProfile.FileName)
C#
Aurigma.GraphicsMill.Bitmap bitmap = 
    new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg");
//Choose LittleCMS color management engine
bitmap.ColorManagement.ColorManagementEngine = Aurigma.GraphicsMill.Transforms.ColorManagementEngine.LittleCms;

//Assign current sRGB profile
bitmap.ColorProfile = Aurigma.GraphicsMill.ColorProfile.FromSrgb();

//Save image with embedded color profile
bitmap.Save(@"c:\Mountain2.jpg", 
    new Aurigma.GraphicsMill.Codecs.JpegEncoderOptions());
Note When you load the color profile into the Bitmap object, it is copied into the temporary file (it is true both for embedded profile and a profile loaded from the .icc file). The lifetime of this temporary file is the same as a lifetime of the Bitmap object. After Bitmap is disposed, the temporary file is automatically deleted.