User 275943b04a
21-11-2014 17:26:06
Hi,
we need to move all our Java infrastructure (Server side and client side) to Java8. I have noticed that images with transparent backgrounds turn out better with JDK6 rather than JDK8 (see attached). Is there any way to get Java8 generating the same image as Java6? Below is the code snippet for the image generation. I've used JChem 5.9.1 in this instance (although I've tried several other JChem versions and they seem to do the same thing).
Thanks muchly (apologies if this has come up before, I've seen similar threads but not exactly this problem)
D
Molecule importMol = MolImporter.importMol("CN1C=NC2=C1C(=O)N(C(=O)N2C)C");
byte[] image = MolExporter.exportToBinFormat(importMol, "png:transbg");
// File file = new File("testTransparent_jdk1.6.0_26.png");
File file = new File("testTransparent_jdk1.8.0_20.png");
FileOutputStream fileOutputStream = new FileOutputStream(file);
fileOutputStream.write(image);