Retain Image quality as Microsoft Powerpoint

Hi Support,

Using Microsoft Powerpoint, i can save a ppt file as mulitple jpg files.

How do i get the same image quality and resolution as above using Aspose Java library?

Regards,
Prashant

I saved a sample ppt as jpg using Microsoft PowerPoint and the dimensions were 960 x 720, horizontal and vertical resolution are 96 dpi.The same ppt was converted to images via Aspose JAVA library and dimensions were 720 x 540, horizontal and vertical resolution are 96 dpi.

I saved another sample ppt as jpg and its dimensions were 1280 x 720, horizontal and vertical resolution are 96 dpi.The same ppt was converted to images via Aspose JAVA library and dimensions were 960 x 540, horizontal and vertical resolution are 96 dpi.

How do i retain the same properties as that of Microsoft PowerPoint converted images.

BufferedImage thumbnailImage = slide.getThumbnail(1.0f, 1.0f);

@pprashant,

I have observed your requirements and like to share that Aspose.Slides renders the slide to image by retaining the actual size of slide. Whatever is the slide dimension, the rendered thumbnail has the same dimensions using scale factor 1. If you facing any issue then please provide the source presentation, generated thumbnails and used sample code. I will investigate the issue further on my end to help you out.

I have uploaded the converted images using Microsoft PowerPoint and Aspose Java Library 17.7.
The zip contains the original ppt as well.

Sample code snippet:

Presentation presentation = new Presentation(sourceFile);
ISlideCollection slides = presentation.getSlides();
for(ISlide slide : slides){
BufferedImage thumbnailImage = slide.getThumbnail(1.0f, 1.0f);
StringBuilder imageName = new StringBuilder();
imageName.append(input.getTargetFileName());
imageName.append("_");
imageName.append(System.currentTimeMillis());
imageName.append(".");
imageName.append(imageFormat);
String imageFile = input.getTargetLocation() + imageName.toString();
ImageIO.write(thumbnailImage, imageFormat, new File(imageFile));
}

Aspose.zip (290.4 KB)

@pprashant,

I have observed the information shared by you and have also opened the source presentation shared by you in PowerPoint 2010. Please observe this presentation snapshot where by the slide size is 10’’ x 7.5 which is equal to 720 x 540 as Aspose.Slides has 72 pixels/inch. With this information there does not seems to be any issue related to Aspose.Slides as it has generated slide thumbnail of similar slide size as observed in PowerPoint 2010.

@mudassir.fayyaz,

Can we increase 72 pixels/inch to another value?

Also, business users are converting the original powerpoint into images and comparing the quality against Aspose library generated images. Can something be done to get similar quality?

@pprashant

I regret to share that you cannot change the pixels/inch value. However, you can set the scaling factor value inside GetThumbnail() method to get the slide image of any quality based on selected value. Like, if you use scaling factor 2 for X and Y, you will get a slide image with size 1440(720 * 2) x 1080(520 * 2). I hope this will be helpful. I also suggest you to please visit documentation article, Creating thumbnail with user defined dimensions. I hope this will be certainly helpful.

@mudassir.fayyaz,

You mentioned using PowerPoint 2010. How about PowerPoint 2016?

@pprashant,

Can you please provide the snapshot of presentation slide size appearing in PowerPoint 2016 along with PowerPoint 2016 version used on your end. We will investigate the issue further on our end on provision of requested information.

The ppt shared was done using 2016 version.

@pprashant,

I have opened the source presentation in PowerPoint 2016 on my end and please check the attached screen shot showing the slide size when viewed in PowerPoint. There is no difference in slide size as 25.4 cm x 19.05 cm actually means 10 inch x 7.5 inch as there are 2.54 cm in 1 inch. Aspose.Slides also rightly generates the slide thumbnails with scaling factor 1. Moreover, I have already shared the reference related to generating slide thumbnail of on any dimension and you can use that to generate thumbnail.

Thanks @mudassir.fayyaz