convert mol files into image as a batch program

ChemAxon 7c2d26e5cf

26-06-2006 19:14:21

Application to convert one or more mol (or SD) files into images.





Download the attached zip and expand somewhere on your machine.





System requirements:


- Java


- Installed Marvin Beans





Howto launch:


- In Windows:


1. Open a MS-DOS command window.


2. Go to where zip was extracted.


3. Type convert2image.bat





- In Linux / Mac OS X:


1. Open a terminal window.


2. Go to where the zip was uncompressed.


3. Type convert2image.sh





Usage:


If you start the script / batch file without parameters, the help message will be printed.


Syntax: convert2image.bat [--field <name>] <format> <inputfile>...


Code:
convert2image.bat "jpeg:w300,h300" mols1.sdf



or


Code:
convert2image.bat --field cd_ID "jpeg:w300,h300" mols1.sdf



Converts each structure from the specified SD file into jpeg image.


The name of the output image files will be generated from the input file name: mols1.sdf.jpeg, mols1.sdf_1.jpeg, mols1.sdf_2.jpeg


If --field option is specified, the current value of the specified SD field will be the name of the output file.


See more details about it in the applications' help:


Code:
convert2image.bat --help

User 7ecde2a58a

31-01-2007 09:33:19

Hello,





I was quite happy to find this program.





Unfortunately when I tried to start it (convert2image.bat --help), I got the following error message:


Exception in thread "main" java.lang.NoClassDefFoundError: chemaxon/struc/Molecule








Maybe anyone can help?


Windows XP (JRE 1.5.0) , Marvin Beans 4.1.5 installed.





---------------------------------------


Problem found.


You will need to edit the .bat file to set the path of MarvinBeans to the actual settings of your machine.

ChemAxon 7c2d26e5cf

31-01-2007 14:23:01

Quote:
Problem found.


You will need to edit the .bat file to set the path of MarvinBeans to the actual settings of your machine.
Exactly. Since, the batch file searches MarvinBeans.jar by its default location:
Code:
C:\Program Files\ChemAxon\MarvinBeans\lib\MarvinBeans.jar

User e34a92cce5

09-05-2007 16:58:23

When I run convert2image.bat, I am getting this error
Quote:
Exception in thread "main" java.lang.NoClassDefFoundError: test/images/Convert2Image
Do I have to update my MarvinBeans jar file?

ChemAxon 7c2d26e5cf

09-05-2007 17:07:35

The batch file does not find convert2image.jar in the current directory.


Launch the batch file from the directory of convert2image.jar file.

User e34a92cce5

11-05-2007 19:11:34

Thanks, Tamas. Also, a quick question - Is there a way for me to define the quality of a png image that this program generates. In my case, I would like to render a black&white image of the compound with better resolution


Thanks again!

ChemAxon 7c2d26e5cf

14-05-2007 09:53:02

There are two options for display quality (high and low). The high quality is the default. The low quality means that the anti-aliasing is switched off.


If noantialias image export option is given, the output image will be low quality, else high.





Your question does not linking closely to the usage of this custom code.


Please next time post your questions/comments about image export to the Marvin forum: Structure editing, viewing and file formats

User e34a92cce5

10-07-2007 20:38:08

Can I render a bitmap output. Is there an option for .bmp image types?

User 677b9c22ff

11-07-2007 06:32:27

Hi:


check molconvert -h


Graphics formats: emf, jpeg, msbmp, pdf, png, pov, ppm, svg.





Just use msbmp as an option.


Tobias

ChemAxon 7c2d26e5cf

11-07-2007 11:21:09

You can read more about image export here: Image export in Marvin.

User e34a92cce5

16-11-2010 17:56:04

Hi,


Does convert2image not automatically draw aromatic rings when converting .mol to .png format. I have attached a sample mol file.


Thanks..

ChemAxon 7c2d26e5cf

17-11-2010 15:22:25

Have you tried to give the +a export option as it is described in the documentation?


http://www.chemaxon.com/marvin/help/formats/basic-export-opts.html

User bc1ce546aa

09-09-2011 21:56:00

convert2image does not properly align the text for CO2H groups with the connecting bond (i.e., the CO2H appears with the connecting bond directed at the center of the CO2H string rather than at the "C"). This problem seems to have been reported before, but I haven't found a posted work-around or fix.

ChemAxon 7c2d26e5cf

15-09-2011 16:19:32

It is rather a Marvin image export issue than convert2image bug.


The convert2image is only a contributed code that demonstrates how to use the Marvin Beans API to create image.


If texts are not properly renderered on the generated image, it can be reproducable with MolConverter tool or with the Molecule.toBinFormat method too.


Please attach the generated image and/or the molecule source to check this issue. It will be forwarded to the right person in the Marvin team.