Menu

#2013 Canvas terminal ignores transparency on points

None
closed-fixed
nobody
None
2018-04-28
2018-01-28
Anonymous
No

I've just started playing with gnuplot and am enjoying it and seeing lots of great possibilities so far.

But of course, that's not why I'm here... I think I've found my first gremlin:

The canvas rendererer appears to ignore, or at least mis-apply, transparency in the colour given for points in a series.

By creating a simple 2-column dataset and running it through this plot:

set terminal canvas enhanced size 640,480;
set output "transbug.html";

plot "transbug.txt" with lines  linecolor rgb "blue", \
     "transbug.txt" with points linecolor rgb "#80ff0000" pointtype 7 pointsize 2;

We can see that the points are rendered fully opaque, covering the line, whereas they should be rendered transparently over it - as they are in e.g. the svg and pngcairo terminals (I didn't try others yet).

I'm also attaching a screenshot of what I see, in case it depends on my browser or other libraries somehow; I'm running Firefox 57.0.4 on Debian unstable. I'll also add a 2nd screenshot of how it looks here with the SVG terminal.

(I originally arrived at this through the use of fully transparent points as mouse-over areas to get tooltips on data series without adding points, but as shown, it affects any transparent points.)

Thanks!

2 Attachments

Discussion

  • Daniel Boles

    Daniel Boles - 2018-01-28
    • Attachments has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1,2 @@
     Screenshot_2018-01-28_14-50-37.png (15.5 kB; image/png)
    +Screenshot_2018-01-28_14-53-35.png (14.4 kB; image/png)
    
    • Group: -->
    • Priority: -->
     
  • Daniel Boles

    Daniel Boles - 2018-01-28

    Should've registered right away, but need to in order to get another attachment in, so here we are

     
  • Ethan Merritt

    Ethan Merritt - 2018-01-29

    You are right. The canvas terminal does not know to use the high 8 bits of a 32bit general-purpose color as an alpha channel. It only knows about transparency as a property of fill areas.

    The canvas terminal has fallen behind both the core capabilities of gnuplot and the implementation of HTML5 in modern browsers. I have quite a long list of things that should be re-coded or re-designed for the canvas terminal, headed by use of the browser's ability to select fonts and render text. That was not an option when gnuplot's canvas terminal was originally written, but now it's silly not to use the vastly superior text-handling built into the browsers rather than the restricted set of Hershey character shapes coded in javascript. I think the javascript support code for gnuplot's canvas terminal should probably be re-written from scratch. Generalizing the color support to handle an alpha channel everywhere would be a small part of that.

    If anyone is looking for a way to contribute to gnuplot, redesigning the canvas terminal would be a good place to start.

     
  • Ethan Merritt

    Ethan Merritt - 2018-02-02

    It turns out that adding alpha channel support everywhere can be done without touching the javascript routines. Therefor there should be no issues of version compaitilbity.
    Fixed for 5.2 and 5.3

     
  • Ethan Merritt

    Ethan Merritt - 2018-02-02
    • status: open --> pending-fixed
     
  • Ethan Merritt

    Ethan Merritt - 2018-04-28
    • Status: pending-fixed --> closed-fixed
     

Log in to post a comment.