Display quality small canvas size

User 3d3feaaf36

20-03-2006 09:56:35

Hi,


i've updated from marvin beans 3.1.x to marvin 4.0.4.


When i draw molecules on a small panel size ( < 100x100 pixels) with


setDispQuality(1) , the carbon structure bonds are drawn with light gray color instead of black or dark gray as it was in marvin 3.1.x.


Because of this effect, small drawn structures are bad readable and when


the quality is set to 0, the drawn structures are not very beautiful.





Is there a way to bypass this "light gray" effect without setting the quality to 0 ?





Thanks,


Martin

User 52167fe300

24-03-2006 23:57:49

I had exactly the same issue trying to upgrade 3.1.x to 4.0. I wish chemaxon could provide a solution for this. It is holding up my plan for upgrading the library for this reason.





-Simon

User ef5e605ae6

26-03-2006 16:50:59

Hi,


Very thin black lines appear to be light gray if antialiasing is switched on. More precisely, if the thickness of a line is smaller than 1 pixel, then it will be gray. The thickness of a bond can be smaller than 1 pixel if the molecule is relatively large but it is displayed in a relatively small space. Antialiasing generally improves the quality, and in case of very small magnification, the structures are bad readable anyway. So I cannot really see your point. Could you attach the image of a molecule which was nicer in 3.1.x?


Peter

User ef5e605ae6

27-03-2006 10:04:26

I found the difference.


- Marvin 3.1 (first column on the attached screenshot): thick lines are drawn as filled rectangles, using fillPolygon and drawPolygon. The shorter edge of the rectangle is (int)(0.064*magnification) wide. If 0.064*magnification < 1, then lines are 1 pixel wide and drawn with drawLine. Atom symbols are _not_ antialiased.


- Marvin 4.0 (second column on the screenshot): all lines are drawn using drawLine, the line thickness is 0.064*magnification. Atom symbols are also antialiased.





In Marvin 3.1, the mixing of the two drawing modes (drawLine and drawPolygon/fillPolygon) and the rounding of the thickness resulted in relatively bad quality and strange zooming behavior: the line thickness changes in discrete steps if you decrease the magnification. (See the difference between column 1, row 1 and column 1, row 2.)


This problem was solved later (second column) by using drawLine always and fractional line thicknesses. However, the result is that the structure is light gray if the magnification is small.





A possible solution is to increase the default wireThickness from 0.064 to 0.1. Then


A. lines would be definitely thicker in "normal" magnification (I am not sure how many users would like it...)


B. gray lines would appear at a 2/3 times smaller magnification than currently.


Would you like this solution?

User ef5e605ae6

27-03-2006 15:51:26

I found a better solution. Line thicknesses greater than 1 will remain the same as in Marvin 4.0 but in case of w < 1, w is replaced by a nonlinear function f(w). You can try it as soon as Marvin 4.1 is released. (or in the next beta)