Image quality is lost on manipulating JPEG Tiff Compressed files (C# .NET)

Hi Team,

When rotating the Tiff pages 2 or 3 times,the Image quality is losses.
My requirement is,
I don’t want to increase the image(little bit image size increment is ok.) size as well as I want lossless image with Jpeg Compression.

I am using Aspose.Imaging 19.11.0.0.
I am using TiffExpectedFormat.TiffJpegYCbCr and TiffPhotometrics.Ycbcr.

does Aspose.Imaging 19.11.0.0 provides any solution fot this?

Please provide the demo solution for lossless and maintained image size or suggest me the way for achieving the requirement.

@ankitraman,

I have observed your comments and request you to please share the working sample code, source file, generated output file with lesser quality and desired output file. We will be able to investigate the issue further on our end on provision of requested information.

@mudassir.fayyaz ,
I have created a Console application for this.
And also sometimes I am getting OutOfMemory Exception while rotating Tiff image data multiple times.
Below are the source file and related image data attached.
Please suggest solution.

ImageFiles.zip (1.4 MB)

SourceCodeConsoleApplication.zip (711 Bytes)

OutOfMemoryException.png (17.7 KB)

@mudassir.fayyaz ,
Can you please suggest the solution for this issue?

@ankitraman,

Thank you for sharing the details with us. An issue with ID IMAGINGNET-3649 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue issue will be addressed. In order to deal with OutOfMemory Exception issue, I suggest you to please consider using x64 based application rather than x86 based application.

@mudassir.fayyaz ,
Thank you for reply,
hoping for fixes soon.

@ankitraman,

We will share the updates with you as soon as the issue will be fixed.

Thank you for the update,
Is there any solution your team is going to provide for OutOfMemory exception for x86 based application in future ?

@ankitraman,

When you use x86 based application, you get maximum 3Gb program memory. So, if you are working with big files the requirement of memory grows during rendering and x86 is not suitable application type as you will be getting OutOfMemory Exception. Therefore, I suggested you to use x64 based application as it has got theoretically infinite program memory. I hope the shared elaboration will be helpful.

@mudassir.fayyaz ,
Thank you for clearing the doubts.
I am considering x64 bit application but still I am getting the OutOfMemory exception.
One more scenario I am adding here,
If I am zooming the Tiff image to 30% to 60% and then if I am going to rotate it, still getting OutOfMemory .

Please suggest the solution.
I am using Licensed version of Aspose.Imaging(19.11.0.0)

@ankitraman,

I request you to please share the sample project along with source file reproducing the issue on your end. Please also share the machine specification and Operating System details on your end.

@mudassir.fayyaz ,

I have sent you the sample method privately,which I am using for rotation, for security purpose ,I can not send the source file.

My system configuration are below:

Processor : Intel® Core™ i7 CPU@2.60Hz 2.59Hz
RAM: 16GB
System Type: 64-bit OS x64-based processor
Windows edition: Windows 10 Pro
Aspose.Imaging Version : 19.11.0.0 for .NET
.NET Framework version : 4.6.2

Please provide the way for this issue as early,if possible.
feel free for asking any more details.

@ankitraman,

I have observed that you have made similar inquiry over following thread link as well. I have shared my feedback over following thread for your convenience.

@mudassir.fayyaz ,
If I am using the 10MB of Tiff file having 47 pages and performing the Rotation for all pages then it is taking around 30 minutes of time. even if i am going to rotate the single page this time it is taking almost 2 or 3 minutes of time and application is going in not responding mode.
I observed that it is taking time while saving the tiff image after rotation.

Please find updated Demo source code attached.
SourceCodeConsole.zip (1.1 KB)

Can you please suggest the solution for this issue,Is there other way to decrease the rotation timing?
Because as a Licensed customer I would not like to see this type of performance related issue.

Please suggest as early.

@ankitraman,

I have observed the statistics shared by you and request you to please share the machine statistics on your end so that we may add an investigation ticket in our issue tracking system.

@mudassir.fayyaz
I have already shared the machine Statistics above.
Please let me know if any more thing is required.

@ankitraman,

Can you please provide the source file with which you are observing the performance delay so that I may log issue in our issue tracking system for any further betterment in results.

@mudassir.fayyaz ,
I have already attached the Sample code in this thread and here and also in above messages thread and also I have discussed about this issue here.

Also please provide the solution and code improvement which I wrote for manipulation and saving which is available here.

If possible, then please provide the overview of RasterImage functionality means how to achieve tiff image rotation, manipulation and saving operation using RasterImage.

also I observed here that if tiff file have less pages(such as 4 pages) then rotation operation is perfrmed very quickly i.e in 3 second only but when tiff file have 50 pages with size 10MB+ that time it is taking 30 to 40 minutes in rotation and if I am rotating only one page out of 50 pages that time also it is taking more than 1 minutes to rotate and save.
Here, TiffImage.Save() is taking time.

Kindly suggest the solution as early because same thing I am posting again and again here.

@ankitraman,

Please accept our apologies for inconvenience on your end. We always try our best to help our worthy customers. However, we may need source information in cases related to performance issues occurring on customer’s end to address and resolve them. In your case you have shared that there is a 10MB Tiff file with more than 50 pages taking considerable amount of time on saving. We may address this performance issue on our end with our own similar file and resolve the issue. But it’s possible that even if we resolve the issue w.r.t our own file and it may still not be to acceptable level for your source file. Therefore, we requested you to please provide the actual file with which you are having performance issue so that we may investigate the issue based on that. We have created an issue with ID IMAGINGNET-3666 in our issue tracking system to further investigate this on our end and will share feedback with you as soon as the issue will be fixed. However, we will really appreciate, if you may please share the actual source file with us.

@ankitraman,

We have invesitgated the issue internally on our end. Below are the results of measuring the performance for the attachment:“10MB_Tif.tif” on our side, for obfuscated Aspose.Imaging 19.12 library:

  •  Rotating one page with saving takes about 10.2s;
    
  •  Rotating all 44 pages with saving 15.8s, memory consumption: up to 4Gb;
    
  •  Saving without rotating 9.9s;
    

CPU Intel Core i7-8700 3.2GHz
RAM 32Gb