Pptx: Images poor quality

Hello,

We recently purchased Aspose Slides for .Net (currently running version 3.1.1.7) and we run into the following problem:

I have poor results when incorporating images in pptx presentations:

Dim pptImage As ImageEx = _presentationEx.Images.AddImage(Drawing.Image.FromFile("c:\temp\result.png"))

(following some code to place the image on a slide and save the presentation)

The image in the presentation is of poor quality with lots of artefacts (looks like heavy jpg compression).

If I insert the image using powerpoint the quality is perfect.

I tested with three image formats, bmp, png and jpg (with 100% quality). Only with jpg the inserted image was identical to the image inserted directly using powerpoint.

I attached a zip file with the png file and a presentation with two slides. One slide with the file inserted using PowerPoint and a slide with the file inserted using Aspose Slides. The difference should be obvious.

When working with streams (using the Image.FromStream method) results get even more confusing. I stopped investigating after a while.

Seems to me someone should look into this.

Regards,

Caius Caesar

Scanmar

Hello,

Thank you for this information. Actually, png images should be saved as png without any reencoding. We will investigate it and let you know about result.

The issues you have found earlier (filed as 10720) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hello there,

Thanks for addressing the problem. I downloaded the update and tried it out.

I still see a difference between ppt and pptx, though the pptx image in the presentation is better than it was (with an image, originating from a jpg stream as source). I have a workaround though, in which I convert the image to a png stream first. Then the quality is identical (good) between ppt and pptx.

I'll give you my code to clarify what I mean:

To ppt:

Private Sub _placePicture(ByVal slide As Aspose.Slides.Slide, ByVal imageStream As IO.Stream, ByVal position As picturePositions, ByVal sizeFactor As Single)

Dim picture As New Aspose.Slides.Picture(_presentation, imageStream)

_presentation.Pictures.Add(picture)

....

following some code to place the picture

To pptx:

Private Sub _placePictureex(ByVal slide As Aspose.Slides.Pptx.SlideEx, ByVal image As Drawing.Image, ByVal position As picturePositions, ByVal sizeFactor As Single)

'workaround for getting better image quality. If I don't convert image to png stream and than back to image,

'the quality of the image is bad.

Dim stream As New IO.MemoryStream

image.Save(stream, Drawing.Imaging.ImageFormat.Png)

image = Drawing.Bitmap.FromStream(stream)

Dim pptImage As Aspose.Slides.Pptx.ImageEx = _presentationEx.Images.AddImage(image)

...

following some code to place the picture

Hi,

What i observe, the text in the image becomes blur, when written to the pptx. Is it your point?

My point is that the image in powerpoint is of worse quality than when I save the image straight to file. It's not only blurring but there are artefacts around color boundaries (off color pixels). It looks to me that these are the result of compression. The image I present to the aspose presentation is a jpeg stream with 100% quality. the image I get looks like a jpeg with - say - 50% quality.

I hope this clarifies the problem?

Hi,

All jpegs currently stored in pptx with a quality of 75% by default. On the other hand, we plan to overcome the blurring problem.