Images with transparant background

ChemAxon fa971619eb

07-07-2007 09:39:27

Is is possible to set a transparant background when writing structures to image files?





I'm using:


mol.toBinFormat("png:w400,h400,b32,scale30,setcolors:a1:blue:a2:black:b1:blue:b2:black")


and the documentation makes some reference to setting an alpha channel, but I can't figure this out.





Thanks





Tim

ChemAxon 7c2d26e5cf

09-07-2007 20:56:16

In current Marvin, there is no way to define transparent color for Molecule.toBinFormat(...).

ChemAxon fa971619eb

10-07-2007 07:18:34

Thanks. This javadoc http://www.chemaxon.com/marvin/doc/api/chemaxon/struc/Molecule.html#toBinFormat(java.lang.String)


suggests that it can be specified, but when


png:w300,h300,b32,#00ffff00


is used you get an exception.





Exception in thread "main" java.lang.IllegalArgumentException: Invalid color specification "#00ffff00"


at chemaxon.marvin.modules.ImageExport.parseOption(ImageExport.java:319)


at chemaxon.marvin.modules.PngExport.parseOption(PngExport.java:118)


at chemaxon.marvin.util.MolExportModule.open(MolExportModule.java:211)


at chemaxon.marvin.util.MolExportModule.open(MolExportModule.java:177)


at chemaxon.marvin.modules.ImageExport.open(ImageExport.java:90)


at chemaxon.marvin.modules.PngExport.open(PngExport.java:92)


at chemaxon.struc.Molecule.exportToObject(Molecule.java:1303)


at chemaxon.struc.Molecule.exportToObject(Molecule.java:1289)


at chemaxon.struc.Molecule.exportToBinFormat(Molecule.java:1205)


at chemaxon.struc.Molecule.toBinFormat(Molecule.java:1182)





Thanks





Tim

ChemAxon 7c2d26e5cf

10-07-2007 07:56:28

The javadoc is not correct.


Throwing exception is OK in this case, since alpha channeled colors are not accepted by Marvin.


Of course, we will check how to solve that Marvin supports transparent colors.

User 8a7878ec6d

26-08-2014 13:23:25

Hi,


Is possible with mMarvin 6.3 to set a transparant background?


Evert

ChemAxon 5693b0ec15

28-08-2014 12:05:07

Dear Evert,


 


To export an image with no background:


Choose File<Export to image and there one of the below formats:


 


.png .svg, and .emf


 


A dialog will be opened where you can select Alpha Chanel/Transparent options.


 


Additionaly, it is possible to export images using Molconverter. Here the transbg parameter should be set.  For more options you can consult


https://docs.chemaxon.com/display/FF/Image+Export+in+Marvin


 


If you need more assistance please do not hesitate to contact us.


 


Best wishes,


Nikolett Mihala