From: Angel H. <ang...@ua...> - 2009-12-21 20:40:16
|
I am testing the use of transparent gif files inserted into Jmol using set echo myNamedEcho IMAGE "myFileName" I created some GIFs with transparency. Jmol (11.8.11) does not respect the transparency, but instead makes transparent always the color of the top-left pixel. And whatever was my transparent color comes out as black (although the applet background, set using jmolSetAppletColor, is not black) Is this serving any purpose? I was prepared to see that transparency might be ignored, but having another color made the transparent one is disconcerting. |
From: Graeme K. <coo...@ho...> - 2009-12-21 23:49:14
|
I do find it strange how the white pixels in the GIF get converted to the top-left pixel of the applet. After playing around with the images I noticed I was able to get them to stay white by applying a gentle gradient, so almost all the white pixels were a slightly different shade. I have attached the images if you want to add them to your example. -----Original Message----- I am testing the use of transparent gif files inserted into Jmol using set echo myNamedEcho IMAGE "myFileName" I created some GIFs with transparency. Jmol (11.8.11) does not respect the transparency, but instead makes transparent always the color of the top-left pixel. And whatever was my transparent color comes out as black (although the applet background, set using jmolSetAppletColor, is not black) Is this serving any purpose? I was prepared to see that transparency might be ignored, but having another color made the transparent one is disconcerting. |
From: Graeme K. <coo...@ho...> - 2009-12-22 04:25:43
|
After looking through the source some more I managed to find this line in the text3D class: int bgcolor = (isBackground ? 0 : argbBackground == 0 ? buffer[0] : argbBackground); Changing it to read a pixel in the middle fixes the images int bgcolor = (isBackground ? 0 : argbBackground == 0 ? buffer[55] : argbBackground); Sadly my understanding is not good enough to know why it needs to look at one pixel to determine if the image uses transparency and why the other methods haven't picked up on it either. |
From: Angel H. <ang...@ua...> - 2009-12-22 09:35:28
|
El 22 Dec 2009 a las 4:25, Graeme Kidd escribió: > Sadly my understanding is not good enough to know why it needs to look at > one pixel to determine if the image uses transparency and why the other > methods haven't picked up on it either. Yes, I found that the first (top-left) pixel is used for transparency. Don't know why. I have put a post in the jmol- developers list. |
From: Angel H. <ang...@ua...> - 2009-12-22 10:47:16
|
El 21 Dec 2009 a las 23:48, Graeme Kidd escribió: > I have attached the images if you want to add them to your example. Unfortunately, those are good only for black applet. Jmol is still using the first pixel for transparency. What I wanted is that the corner images will be white outside and transparent inside so they will pick whatever background color the applet has. That assumes the page background is white; otherwise, a different set of images is needed. The advantage, as you saw, is that images inserted into Jmol using echo are in front of the model, so they effectively hide the molecule when it comes close to the edge. (Differently to the CSS approach) |
From: Robert H. <ha...@st...> - 2009-12-23 01:05:14
|
This bug is fixed for Jmol 11.8.15 and Jmol 11.9.13. You can now have a transparent GIF or PNG image in an echo and also set the echo background color independently. You can now have a transparent GIF or PNG image for the background and also have a background color. One caveate -- setting background red will remove an image if it is present. If you use instead color background red then that will not clear the image. Bob 2009/12/22 Angel Herráez <ang...@ua...> > El 21 Dec 2009 a las 23:48, Graeme Kidd escribió: > > > I have attached the images if you want to add them to your example. > > Unfortunately, those are good only for black applet. Jmol is still > using the first pixel for transparency. > What I wanted is that the corner images will be white outside and > transparent inside so they will pick whatever background color the > applet has. That assumes the page background is white; otherwise, a > different set of images is needed. > > The advantage, as you saw, is that images inserted into Jmol using > echo are in front of the model, so they effectively hide the molecule > when it comes close to the edge. (Differently to the CSS approach) > > > > > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and > easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Jmol-developers mailing list > Jmo...@li... > https://lists.sourceforge.net/lists/listinfo/jmol-developers > -- Robert M. Hanson Professor of Chemistry St. Olaf College 1520 St. Olaf Ave. Northfield, MN 55057 http://www.stolaf.edu/people/hansonr phone: 507-786-3107 If nature does not answer first what we want, it is better to take what answer we get. -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900 |