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

Free Support Forum - aspose.com

Aspose Imaging - Image conversion transparency lost

Hi,

I tried converting image from PNG to JPEG using Aspose Imaging 2.1.0.0. The input image was a transparent and the output had a black background.

PFA for the image input and output.

Below is the code I used

Image image = Image.load("input.png");<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

image.save("output.jpg", new JpegOptions());

Please help me out in this. We do have a license version of Aspose total in JPMC.

Thanks,

Amit

Hi Amit,


Thank you for contacting Aspose support.

In my understanding, the Jpeg file format does not support storing an alpha channel with the image like PNG does, therefore you may not be able to retain the transparency of PNG images while converting them to Jpeg format. Although, I have noticed that the transparent area in PNG has been rendered with black color, making the black text on the image unreadable. There should be an option (currently not available) to set a desired color for the transparent area of the PNG.

A ticket IMAGING-34134 has been logged in our bug tracking system to check if transparency of PNG image could be retained while converting it to Jpeg. Moreover, we will also look into the feature of setting desired color for transparent area during the PNG to Jpeg conversion.

Please spare us little time to properly analyze your inquiry on our end. In the meanwhile, we will keep you posted with updates in this regard.

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.