On Thu, Sep 2, 2010 at 9:23 AM, Benjamin Root <ben.r...@ou.edu> wrote: > This also raises another pet peeve of mine. The Agg backend seems to use > linear blending for alpha. This is inconsistent with how the world works. > It is more realistic for logarithmic blending, or at least, a piece-wise > linear blending. > > Imagine I have two overlapping objects with alpha set to .5 (a_1 and a_2). > What is rendered in matplotlib is completely opaque. A more realistic > result would have a final alpha setting of .75 (i.e. - the first item takes > away half the transparency, then the second item takes away half of the > remaining transparency. > > I am not nearly familiar enough with the Agg backend to know how to > implement this. Is this at all feasible?
I'm not sure this is what's going on. Right now, though, I'm seeing some weird draw artifacts that I don't have time to run down. What I will say is that while some other blending functions may be interesting, I don't think it's widely supported. OpenGL just treats the alpha as a weight for the colors. You can tweak it, but it's inherently linear unless you write a pixel shader. Also, I don't think the blending produces an opaque result. I'm pretty sure you can blend 3 colors together, each with an alpha > 0.5. The color will be pretty saturated, but opaque would mean the bottom color doesn't show through. (I'll hack on an example later). Remember, though, that your monitor doesn't display an "alpha" color. Any translucency from a net blending of colors just means that you're blending in a background color (alpha=1.0) somewhere. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users