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:
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)
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:
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)
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());
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.