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

Free Support Forum - aspose.com

Color radiance issues in images

Hi there,

We are using aspose-imaging-18.6.1-jdk16.jar for converting the EMF images to SVG format.

We are seeing issues related to color radiance.

We are using the below code snippet for converting.

String dataDir = “C:\ media\”;
Image image = Image.load(dataDir + “image34.emf”, new MetafileLoadOptions(true));
try {
// Create an instance of EmfRasterizationOptions class and set
// different options
final EmfRasterizationOptions emfRasterizationOptions = new EmfRasterizationOptions();
//emfRasterizationOptions.setBackgroundColor(Color.getWhite());
emfRasterizationOptions.setPageWidth(image.getWidth());
emfRasterizationOptions.setPageHeight(image.getHeight());

// convert it to SVG format.
image.save(baseDir + file.getName()+".svg", new SvgOptions() {
{
setVectorRasterizationOptions(emfRasterizationOptions);
}
});
} finally {
image.dispose();
}
//ExEnd:ConvertEMFtoSVG

images-03.zip (45.7 KB)

@gmusturi,

I have observed your comments. An issue with ID IMAGINGJAVA-1025 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.

Hi there,

We have been told that the color radiance issue has been addressed as part of aspose-imaging-18.8-jdk16.jar

I just tested the fix and could still color radiance issue when I zoom out the converted SVG image.

Attached images are for your reference.

Thanks

179237.zip (37.2 KB)

@gm69267,

I have observed your comments. Can you please try to use below sample code on your end and share feedback with us if there is still an issue.

String baseFolder = “C:\IMAGINGJAVA-1025\”;
String fileName = “image34.emf”;
String inputFileName = baseFolder + fileName;
String outputFileName = baseFolder + fileName + “.svg”;
Image image = Image.load(inputFileName);
try
{
EmfRasterizationOptions emfRasterizationOptions = new EmfRasterizationOptions();
emfRasterizationOptions.setPageSize(Size.to_SizeF(image.getSize()));
SvgOptions svgOptions = new SvgOptions();
svgOptions.setVectorRasterizationOptions(emfRasterizationOptions);

image.save(outputFileName, svgOptions);
}
finally
{
image.close();
}

Yes, I could still see the issue with above code snippet too. Pls let me know if you need any more details.

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

@gm69267,

Please try using suggested code using Aspose.Imaging for Java 18.8 and with license applied.

Hi there,

I used 18.8 version with licence applied.

Thanks

@gm69267,

Can you please provide the desired output and generated output for reference that I may shared in our issue tracking system.

Here are input EMF and generated SVG images. Color radiance issue happens when you zoom out of the converted SVG image.

Thanks,

179237.zip (37.2 KB)

@gm69267,

The issue MAGINGJAVA-1025 has been added for color radiance in old version when black and white image was getting rendered. However, with above shared code using Aspose.Imaging for Java 18.8 the SVG seems to have colored image as compared to black and white. For your convenience, I have attached both SVG files. Can you please point specifically to us that what else is issue in exported SVG.

179237.zip (35.9 KB)

When we zoom out, the color radiance is lost. Please refer the images below. When zoom is at 100%, we could see both colors red and green. When we zoom the image to 150%, we only get to see red color and we no longer see green color. But it is not the case with EMF image, i.e both the colors are displayed when you zoom to any percentage.

Thanks

179237-1.zip (143.7 KB)

@gm69267,

I have observed your comments. Can you please share in which browser or software you observed this problem. I have opened your files shared with us in Microsoft Edge and Google Chrome and unable to observe issue on zoom level 150.

Hi there,

I am using IE 11 : Version - 11.0.9600.19035

Thanks,

Browser-version.png (17.1 KB)

@gm69267,

I have been able to reproduce the issue on my end. An issue with ID IMAGINGJAVA-1076 has been created in our issue tracking system to investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

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