Free Support Forum - aspose.com

Expected Performance for Aspose.Words- Aspose.Imaging- Aspose.Pdf to .tiff

I have an application that allows a user to interactively upload and retrieve documents from IBM’s OnDemand Repository. The OnDemand administrator has requested all documents be stored as .tiff format so I am using Aspose.Total to convert various formats I receive to TIFF. I would like to know if the conversion times I’m seeing are typical.

Aspose.Words for .NET - Convert 1.6MB .txt file to .tiff. Approx 1 minute. Resulting .tiff is 35MB.

Aspose.Imaging for .NET - Convert 16MG .jpeg file to .tiff. Approx 6 minutes. Resulting .tiff is 39MB.

I am loading the document from a file and calling the save methods to do the conversions.

Thank you for your time.

Hi Larry,

Can you please share a few sample input documents which are taking more time and producing large output files at your end?

This will help us reproduce the issue at our end and analyze it further.

Best Regards,

The following is a txt file I have been using. My jpg has confidential data so I will need to look for a new version.

I have attached the jpg file that I am converting to tiff. The following are the options I am using:



using (Aspose.Imaging.Image imageDoc = Aspose.Imaging.Image.Load(MyDir + “InputImage.jpg”))

{

Aspose.Imaging.ImageOptions.TiffOptions tiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions();

tiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;

tiffOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;

tiffOptions.BitsPerSample = new ushort[] { 8 };

tiffOptions.Predictor = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPredictor.None;

tiffOptions.ResolutionUnit = Aspose.Imaging.FileFormats.Tiff.Enums.TiffResolutionUnits.Inch;

tiffOptions.Xresolution = new Aspose.Imaging.FileFormats.Tiff.TiffRational(200);

tiffOptions.Yresolution = new Aspose.Imaging.FileFormats.Tiff.TiffRational(200);



//Export to TIFF file format using the default options

imageDoc.Save(MyDir + “InputImage.tiff”, tiffOptions);

}

Hi Larry,

As far as your TXT file is concerned, we were able to reproduce output file size issue and it has been logged into our issue tracking system as WORDSNET-12227. We will keep you updated on this issue in this thread.

As this file contains text only and there are around 1400 pages so time taken in conversion is expected and MS Word takes lot more time to convert this file to other formats as compared to Aspose.Words. This time will be further reduced once the above mentioned size issue is resolved.

We are also investigating the issue with your JPEG file and will update you on this soon.

Best Regards,

larry.schreiber:
I have attached the jpg file that I am converting to tiff. The following are the options I am using:
        using (Aspose.Imaging.Image imageDoc = Aspose.Imaging.Image.Load(MyDir + "InputImage.jpg"))
        {
            Aspose.Imaging.ImageOptions.TiffOptions tiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions();
            tiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
            tiffOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
            tiffOptions.BitsPerSample = new ushort[] { 8 };
            tiffOptions.Predictor = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPredictor.None;
            tiffOptions.ResolutionUnit = Aspose.Imaging.FileFormats.Tiff.Enums.TiffResolutionUnits.Inch;
            tiffOptions.Xresolution = new Aspose.Imaging.FileFormats.Tiff.TiffRational(200);
            tiffOptions.Yresolution = new Aspose.Imaging.FileFormats.Tiff.TiffRational(200);

            //Export to TIFF file format using the default options
            imageDoc.Save(MyDir + "InputImage.tiff", tiffOptions);
        }</div></BLOCKQUOTE><div><br></div><div>Hi Larry, </div><div><br></div><div>Thank you for sharing the source image and the code snippet. </div><div><br></div><div>We have evaluated the presented scenario while using the latest version of <a href="http://www.aspose.com/community/files/51/.net-components/aspose.imaging-for-.net/default.aspx">Aspose.Imaging for .NET 3.0.0</a>. We have noticed that if we execute your code as it is then it generates a TIFF file of 14.3MB in 27038 milliseconds. You can further tweak the conversion process to control the resultant file size as well as the execution time by adjusting the <i>TiffOptions </i>parameters and/or using the dithering.</div><div><br></div><div>Please note, the default constructor of <i>TiffOptions </i>class has been depreciated therefore it is advised to use the constructor that can accept a constant from the <i>TiffExpectedFormat</i> enumeration for <a href="http://www.aspose.com/docs/display/imagingnet/TiffOptions+Configuration">preset configurations</a>. That means, you do not need to set the parameters like <i>BitsPerSample</i>, <i>Compression</i>, <i>Photometric </i>& <i>Predictor </i>while creating an instance of <i>TiffOptions </i>class, rather you pass the appropriate constant from the <i>TiffExpectedFormat</i> enumeration and let the API decide which values need to be set for the aforesaid parameters.</div><div><br></div><div>In reference to the above discussion, please check the following piece of code that generates a TIFF of 1.5MB in more or less same time as of your original code. If you wish to further decrease the file size and/or the execution time then we suggest you to choose Deflate compression algorithm (<i>TiffExpectedFormat.TiffDeflateBW</i> without dithering).</div><div><br></div><div><b>C#</b></div><div><br></div><div><div class="csharpcode"><span class="kwrd">using</span> (Aspose.Imaging.RasterImage imageDoc = (RasterImage)Aspose.Imaging.Image.Load("D:/InputImage.jpg"))

{
imageDoc.Dither(DitheringMethod.FloydSteinbergDithering, 1);
Aspose.Imaging.ImageOptions.TiffOptions tiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(TiffExpectedFormat.TiffLzwBW);
tiffOptions.ResolutionUnit = Aspose.Imaging.FileFormats.Tiff.Enums.TiffResolutionUnits.Inch;
tiffOptions.Xresolution = new Aspose.Imaging.FileFormats.Tiff.TiffRational(200);
tiffOptions.Yresolution = new Aspose.Imaging.FileFormats.Tiff.TiffRational(200);
imageDoc.Save(“D:/InputImage-TiffLzwBW.tiff”, tiffOptions);
}

Hi Larry,

This is to update you that WORDSNET-12227 is most likely to be closed as not a bug because output TIFF has 1405 pages and big file size is expected for such big files. You can use Ccitt3 or Ccitt4 TIFF compression option to reduce size.

Best Regards,