|
From: Ethan A M. <merritt@u.washington.edu> - 2007-05-05 22:29:14
|
On Saturday 05 May 2007 15:03, Ethan A Merritt wrote: > Even after fixing a bug in unpacking the alpha channel in gp_cairo.c, > I can't get the wxt/cairopdf implementation of this patch to work properly. > I'm thinking that maybe the sub-pixel antialiasing in the cairo library is > messing things up. Recent versions of cairo provide a routine cairo_paint_with_alpha( image, alpha ) This seems to work, but it applies the same alpha value to the whole image, not a pixel-by-pixel value. That causes me to wonder, do we really need a full RGBA format? For real-world usage it might be sufficient to apply the alpha value from "set style fill transparent ..." to the whole image. It gets right back to the question of what an alpha channel capability would really be used for. Let's throw it back to the mailing list: Hey everyone, If it were possible to handle a separate alpha channel (partial transparency) in gnuplot's "with image" or "with rgbimage" mode, what would you use it for? My thoughts: - You could overlay an image (e.g. a map) onto a plot. But you don't really need an alpha channel for this, because you could draw the map first and then plot on top of it. - You could use an arbitrary non-rectangular bitmap image as a point style. Each point could be a litte icon. Cute, but is it really useful? - The only real use I can think of: painting a heat map onto a surface in 3D, for instance a pm3d representation of electrostatic potential at the surface of a cube, and then making it semi-transparent so that you can see other plot elements (3D vector fields?) through it. The thing is, you can *already* do this in gnuplot, using the new "set style fill transparent solid <alpha>" and pm3d quadrilaterals. It would only require an RGBA mode if you had a need to map a pre-existing image onto the surface, and even then only if each pixel had a separate alpha value. Are there any such real-world cases? -- Ethan A Merritt |