Menu

#2721 [6.0.0] transparency broken on windows in pm3d

None
open
nobody
cairo (8) qt (21)
2025-06-30
2024-06-30
No

With

set colormap new PALETTE_TRANS  # copy current palette into PALETTE_TRANS
do for [i=1:|PALETTE_TRANS|] { PALETTE_TRANS[i] = (PALETTE_TRANS[i] & 0xffffff) | 0x80000000 }  # 0 is opaque

set view map
# set term 'pngcairo'
# set output 'try0.png'
splot '++' using 1:2:(0.0):(($1+$2)) with pm3d fillcolor palette PALETTE_TRANS 

on Windows 7’ default terminal there appears a gray grid on the image. The grid appears also if I do “Export to PDF” from the Windows’ gnuplot graphic terminal (but at different positions). It does not appear with “Export to image” (to PNG), or if I uncomment the PNG output above.

1 Attachments

Discussion

  • Tatsuro MATSUOKA

    confirmed on Qt terminal on gnuplot 6.0.1 on windows 11.
    On wxt and windows terminal a gray grid does not appear.

     
  • Tatsuro MATSUOKA

    The phenomena were observerd oncygwin and Ubuntu on Qt terminal.
    They are specific to Qt terminal but not specific to Windows.

     

    Last edit: Tatsuro MATSUOKA 2024-07-02
  • Ethan Merritt

    Ethan Merritt - 2024-07-02

    Is the try0.pdf file supposed to show this problem? I don't see anything in it that looks like a gray grid when viewed here in okular. Could this be a problem in the viewer rather than in the gnuplot output? That has been a recurring problem and a known bug in many pdf viewers. If so then you may be able to work around the problem by telling gnuplot set pm3d border retrace. That option was added specifically to deal with rendering programs that show imperfect alignment between adjacent rectangles in a tiled surface. PDF viewers are the prime offender, but you might be seeing a similar effect in your Qt rendering pipeline. The downside of the option is that just as the name says it retraces the border of each rectangle. That can have the undesired effect of making the borders less transparent if the same rendering glitch now causes them to overlap slightly rather than producing a spurious gap. That doesn't matter for a fully opaque surface.

     
  • Ilya Zakharevich

    Thanks — but the problem is exacerbated a lot with either of your suggestions — in the same way. Initially, the gray lines are quite subtle.; with your modifications

    • I was testing with SumatraPDF (which is known to not follow the PDF specs 100% — but is a very good indicator of how programs making shortcuts behave. (Coding PDF output, one should take these programs into account — when possible.) With Adobe Reader XI the file try0.pdf shows with very high contrast grid visible between rectangles.
    • with set pm3d border retrace the qt terminal on Win7 shows the same high contrast grid.
     
  • Ilya Zakharevich

    BTW, I make transparent plots withTiKZ in pdflatex all the time, and I do not recollect ever seeing such grid in SumatraPDF. So at least technically, I suspect it is not an insurmountable goal to make this work in “less pedantic” PDF viewers.

     
  • Bastian Märkisch

    • labels: --> cairo, qt
    • Group: -->
    • Priority: -->
     
  • Bastian Märkisch

    FWIW, turning off antialiasing solves the issue for the qt terminal (6.0.3 on Windows) (Note that this is not an issue with the wxt nor windows terminals here.)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.