white space in image

User 870ab5b546

09-05-2006 12:39:57

Hello,





When I save an image of a fairly small molecule in PNG, the image contains a lot of white space around the molecule. Is there a way of saving the image with most of the white space trimmed away?





-- Bob

ChemAxon 7c2d26e5cf

09-05-2006 14:28:41

How did you create this image? Did you use the "File/Save Image" menu in MarvinView/Sketch or you used the Marvin Beans API (Molecule.toBinFormat(...) ) for image generation?


By using the "File/Save Image" menu, Marvin saves the current canvas. In this case, I suggest you to zoom the molecule to fit into the canvas, before saving.


If you work with the API, you can specify the image size or the scaling factor of the molecule. By using each parameter, the molecule will fit into the image bounderies.

User 870ab5b546

09-05-2006 14:49:10

Indeed, I used the File/Save Image menu in MarvinSketch.





Is there a reason why File/Save Image saves the entire canvas? Generally, people aren't interested in the canvas; they're interested in the molecule.





Using the API is awkward for me. I would rather not have to do any math to get the image size I want. It's easier for me to open the image in a graphic editing program and trim the white space.

ChemAxon 7c2d26e5cf

09-05-2006 15:23:20

OK, we will solve to save only the relevant part of the canvas (only the molecule).