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

Saving to JP2 very slow

I am using the Jpeg2 encoder and it is running very slow. It is literally taking minutes to convert an image to jp2, whereas in Photoshop, it saves in seconds.
I tried this:
bitmap.Save(saveFileDialog1.FileName, new Aurigma.GraphicsMill.Codecs.Jpeg2kEncoderOptions(0.1f));


Ive also tried the following with all the different progressionorders.
using (Aurigma.GraphicsMill.Bitmap bitmap = 
            new Aurigma.GraphicsMill.Bitmap(img))
{
   using (Aurigma.GraphicsMill.Codecs.Jpeg2kWriter writer = 
               new Aurigma.GraphicsMill.Codecs.Jpeg2kWriter())
   {
      writer.Open(DestinationFileName);
      writer.Progress += new Aurigma.GraphicsMill.ProgressEventHandler(aurBitmap_Progress);

      using (Aurigma.GraphicsMill.Codecs.Jpeg2kFrame frame = 
                  new Aurigma.GraphicsMill.Codecs.Jpeg2kFrame())
      {
         frame.Rate = rateOfCompZeroToOneScale;
         frame.Compression = Aurigma.GraphicsMill.Codecs.CompressionType.WaveletLossy;
         frame.ProgressionOrder = Aurigma.GraphicsMill.Codecs.Jpeg2kProgressionOrder.Pcrl;
         frame.SetBitmap(bitmap);

         writer.AddFrame(frame);
      }
   }
}


I am running version 3.5.405.0 of the Aurigma.GraphicsMill assembly (.net 1.1)
Any ideas on how to speed this up. These conversion times are unexceptable to my client, so I'm feeling some heat 😞
Hello Todd,

Unfortunatelly we have to confirm this problem with our Jpeg2000 encoder. We are going to fix this issue in future releases.
I found the same thing, but I noticed that it only seems to happen for higher-resolution images.

I have found that a safe level seems to be any image where Width * Height < 2600000

In one of my apps I have been checking the resolution and saving to JPEG2000 only if the resolution is low enough for the saving speed to be fast, like this:

				if (MyBitmap.Width * MyBitmap.Height <= 2600000)
				{
					// Compress with JPEG 2000
					MyBitmap.Save(stream, new Aurigma.GraphicsMill.Codecs.Jpeg2kEncoderOptions(0.07f));
				}
				else
				{
					// Compress with standard JPEG
					MyBitmap.Save(stream, new Aurigma.GraphicsMill.Codecs.JpegEncoderOptions());
				}