Wrong color conversion when rendering JPEG to PNG (Java)

Hello,

I have an application that loads and processes images. I want to use Aspose.Imaging only to load image and produce a java.awt.image.BufferedImage instance. This can be achieved by the following conversions flow:
com.aspose.imaging.Image -> ByteArrayOutputStream -> ByteArrayInputStream -> BufferedImage

Eventually the image after being processed, is saved on file system. The issue is that there are some images like the one attached, for which the background color gets Pale although it is originally White.

In order to isolate the issue i have tried a test code which does not include any intermediate processing of image, but instead it just loads it and saves it on file system again:

com.aspose.imaging.Image asposeImage=
com.aspose.imaging.Image.load(“C:/Users/dpili/Desktop/mark.jpg”);
asposeImage.save(“C:/Users/dpili/Desktop/aspose.jpg”);

The saved image has a pale background. I also notice that asposeImage.getOriginalOptions() returns NULL.
Also the size of saved image is much bigger than the original.

A would appreciate a feedback on that
Regards,
Dimitris Pilios

mark.jpg (33.8 KB)

@dimitris.pilios,

I have worked with source file and sample code shared by you and have been able to observe issue. An issue with ID IMAGINGJAVA-1290 has been created in our issue tracking system to investigate the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.

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

@dimitris.pilios,

Please use following sample code at your end to resolve this issue. Please share feedback with us if there is still an issue.

String basePath = “D:\”;
String fileName = “mark.jpg”;
String inputFileName = basePath + fileName;
String outputFileName = inputFileName + “.new.png”;
Image image = Image.load(inputFileName);
try
{
image.save(outputFileName, new PngOptions());
}
finally
{
image.close();
}