This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Creating Images is too slow

Hi,
i have a Problem with creating Images.
I need to create about 100000 in a Row.

With this Code, it lasts nearly a second per Image.

            Aurigma.GraphicsMill.Bitmap theTiffFile = myTiffFile;
            theTiffFile.ColorProfile = Aurigma.GraphicsMill.ColorProfile.FromSrgb(); ;
            theTiffFile.ColorManagement.ColorManagementEnabled = true;
            theTiffFile.ColorManagement.CmykColorProfile = new Aurigma.GraphicsMill.ColorProfile(theProfilePath); ;
            theTiffFile.ColorManagement.TransformationIntent = Aurigma.GraphicsMill.Transforms.ColorTransformationIntent.RelativeColorimetric;
            //the next line lasts long
            theTiffFile.ColorManagement.ConvertToContinuous(Aurigma.GraphicsMill.ColorSpace.Cmyk, false, false);
            string theFileName = theParameter.Counter.ToString("000000");
            System.IO.MemoryStream theMemoryStream = new System.IO.MemoryStream();
            System.IO.FileStream theFileStream = System.IO.File.Create(myFilePath + @"\" + theFileName + ".tif");
            //the next line lasts long
            theTiffFile.Save(theMemoryStream, new Aurigma.GraphicsMill.Codecs.TiffEncoderOptions(CompressionType.None));
            theMemoryStream.Capacity = (Int32)theMemoryStream.Length;
            theFileStream.Write(theMemoryStream.GetBuffer(), 0, theMemoryStream.GetBuffer().Length);
            theFileStream.Flush();
            theFileStream.Close();
            theMemoryStream.Close();
            theMemoryStream.Dispose();
            theFileStream.Dispose();
            theTiffFile.Dispose();


Do you have an idea, how i can fasten the convert and save part?

regards

Christian
Hello Christian,

Your source code is OK. The problem is in color management, it is rather slow operation. If you disable this option - the process will speed up.

Unfortunately there is no way to speed up conversion from one color space to another using color management.
ok, but if i diable Color Management, The Colors look different.
Is it because of the ColorProfile, that converts the Image to CMYK, or is it converting without Color Management, converts wrong Colors?
Color management helps to convert colors from one color space to another with minimum difference. Unfortunately if you need color compliance - you have to use color management.