Convert VSD/VSDX to PNG in Java using Aspose.Diagram - Color is different in output PNG

Hello,

I am using aspose.diagram v6.7.0 to generate PNG of page - 'Page-1' of the attached visio file. Incorrect colors come in the PNG output.

I have attached a screenshot comparing the PNG with the Actual Visio Page. Notice the difference in the colors of PNG output and original diagram colors.

The PNG output should look the same as the actual diagrams. The colors should be rendered as they are in actual diagrams.

Following code is used to generate the PNG output:

Diagram diagram = new Diagram("test.vst");
String pageName = "Page-1";
Page srcPage = diagram.getPages().getPage(pageName);
File outputFile = new File("output.png");
int imageFormat = SaveFileFormat.PNG;

int pageIndex = 0;
ImageSaveOptions options = new ImageSaveOptions(imageFormat);
options.setResolution(96);
for (Page page : (Iterable) diagram.getPages()) {
if (page.getID() == srcPage.getID()) {
options.setPageIndex(pageIndex);
options.setPageCount(1);
break;
}
pageIndex++;
}
diagram.save(outputFile.getAbsolutePath(), options);

Can you please analyse this issue.

Thanks,
Neha

Hi Neha,


Thank you for the inquiry. We managed to replicate the problem of the missing foreground color of various shapes. It has been logged under ticket id DIAGRAMJAVA-50361 in our bug tracking system. Your post has also been linked to this ticket. We’ll let you know once a significant progress has been made in this regard. We’re sorry for the inconvenience caused.

The issues you have found earlier (filed as DIAGRAMJAVA-50361) have been fixed in Aspose.Diagram for Java 20.2.