We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ImageCompression produces inverted image

Aspose.PDF for .Net 20.8.0

Sample code :

        var inpf = @"D:\JIRA\Datacom\1 scanned 2 pages.pdf";
        var outf = @"D:\JIRA\Datacom\scanned_comp.pdf";

        var doc = new Aspose.Pdf.Document(inpf);
        var optimizeOptions = new Aspose.Pdf.Document.OptimizationOptions();
        optimizeOptions.ImageCompressionOptions.CompressImages = true;
        optimizeOptions.ImageCompressionOptions.ImageQuality = 80;
        optimizeOptions.ImageCompressionOptions.ResizeImages = true;
        optimizeOptions.ImageCompressionOptions.MaxResolution = 96;
        optimizeOptions.RemoveUnusedObjects = true;
        optimizeOptions.RemoveUnusedStreams = true;
        optimizeOptions.LinkDuplcateStreams = true;
        optimizeOptions.AllowReusePageContent = true;
       
      
        doc.OptimizeResources(optimizeOptions);
        doc.Save(outf);

1 scanned 2 pages.zip (6.4 MB)

The compressed document has inverted colors.

1 Like

@pnocera

We were able to notice the similar issue in our environment while testing the scenario using Aspose.PDF for .NET 20.9. Therefore, we have logged an issue as PDFNET-48747 in our issue tracking system for the sake of correction. We will further look into its detail and keep you informed about its resolution status. Please be patient and spare us some time.

We are sorry for the inconvenience.

1 Like

Any news about this ?

Thanks,
Pierre

@pnocera

We are afraid that there are no updates yet. The ticket was logged recently in our issue management system and will be investigated/resolved on first come first serve basis. We will surely share updates with you as soon as we have some results against the investigation. Please have patience and give us some time.

We are sorry for the inconvenience.

Hi asad,

It’ll be the 3rd months anniversary of this ticket, which issue avoids us from selling our product to customers.

Please do something : fix it.

Thanks,
Pierre

@pnocera

We really apologize for the inconvenience being faced due to this issue. We would like to share with you that the earlier logged ticket is currently under the phase of investigation and as soon as its analysis is completed, we will be able to share some updates regarding its fix with you. You will surely be notified as soon as we have some news about resolution ETA. Please give us little time.

We are sorry for the inconvenience.

Hi asad, do we have any news on this ?

Thanks,
Pierre

@pnocera

We are afraid that the investigation of the ticket could not get completed due to its complex nature as well as other issues in the queue logged prior to it. However, your concerns have been recorded and will be considered as well during issue resolution. We highly appreciate your patience and comprehension in this regard. We will inform you as soon as we have additional updates regarding ticket resolution.

We apologize for the delay and the inconvenience.

I have the same issue. I am applying compression using the Images.Replace() method and I get inverted colors. I unfortunately cannot include the file this is happening on as it contains private health information. I have included screenshots with PHI removed as an example.

This is the code I am using:
page.Resources.Images.Replace(1, page.Resources.Images[1].ToStream(), 70, true);

The following screenshots show a little piece of the resulting PDF. The one with the black background is the inverted image colors I am talking about when I use the image compression in Images.Replace(). The one with the white background is without color inversion.

I am using Apose.Pdf for .NET version 21.11.0.0.
image.png (4.7 KB)
image.png (5.8 KB)

@puremass

We are afraid that earlier logged ticket has not been yet resolved as it is currently under the phase of investigation. However, we have recorded your concerns and logged the provided information under the ticket. We will surely update you in this forum thread as soon as the issue is rectified. Please be patient and spare us some time.

We apologize for your inconvenience.