This project has moved. For the latest updates, please go here.

Lead Tools conversion

Mar 19, 2014 at 7:12 PM
I'm in the process of investigating switching from the LeadTool's imaging conversion stuff to Magick.Net. LeadTools allows me to read the profile from one image and write it to another, i.e.
 var iccProf = new IccProfileExtended();
 iccProf.ReadFromImage(sourceFilePath, 0);
 iccProf.WriteToImage(destinationStream, 0);

Does Magick.net have something similar?
Coordinator
Mar 20, 2014 at 6:58 AM
Edited Mar 20, 2014 at 7:00 AM
Magick.NET does offer something similar. I am not sure how the technique from above works but Magick.NET has to read the whole image for this to work. There is an option in Magick.NET that will skip the image data of the source image but that is not publicly available yet. I will make this available the next release. You still need to read the whole destination image. An example of how you should copy the profile is this:
using (MagickImage source = new MagickImage())
{
  source.Ping("source.tif"); // Not yet available use Read for now.

  ColorProfile profile = source.GetColorProfile();
  using (MagickImage destination = new MagickImage("destintion.tif"))
  {
    destination.AddProfile(profile);
    destination.Write("destination.tif");
  }
}