[pstricks] Ghostscript 9.53 transparency operators

Alexander Grahn A.Grahn at hzdr.de
Tue Mar 30 14:17:35 CEST 2021


Hi all,

the new PostScript transparency operators in Ghostscript are still not
used, despite the definitions at the top of pstricks.pro.

The warning

   **** WARNING: .setopacityalpha is deprecated (as of 9.53.0) and will be removed in a future release
   **** See .setfillconstantalpha/.setalphaisshape for the improved solution

written to the terminal multiple times indicates that old operators are still
being used.

If I add the code that follows at the top of the input file, before
\documentclass..., the warning goes away, while transparency is
correctly assigned to the graphical objects in the PDF output:

    %%%%%%%%%%%%%%%%% fix PSTricks' transparency setup %%%%%%%%%%%%%%%%%
    \begin{filecontents}[overwrite,noheader]{pst-fixtransparency.pro}
      /.setfillconstantalpha.bak /.setfillconstantalpha load def
      /.setstrokeconstantalpha.bak /.setstrokeconstantalpha load def
      /.setalphaisshape.bak /.setalphaisshape load def
    \end{filecontents}
    \begin{filecontents}[overwrite,noheader]{pst-fixtransparency.sty}
      \AtBeginDvi{
      \special{header=pst-fixtransparency.pro}
      \special{!
        /.setfillconstantalpha /.setfillconstantalpha.bak load def
        /.setstrokeconstantalpha /.setstrokeconstantalpha.bak load def
        /.setalphaisshape /.setalphaisshape.bak load def
        /.setopacityalpha {
          dup .setfillconstantalpha .setstrokeconstantalpha} def
        /.setshapealpha {
          dup .setfillconstantalpha .setstrokeconstantalpha
          true .setalphaisshape} def
      }
    }
    \end{filecontents}
    \RequirePackage{pst-fixtransparency}
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Could the file pstricks.pro be adapted accordingly, please?

Thanks and regards.



Here is a complete example (latex + dvips + ps2pdf -dALLOWPSTRANPARENCY):

%%%%%%%%%%%%%%%%% fix PSTricks' transparency setup %%%%%%%%%%%%%%%%%
\begin{filecontents}[overwrite,noheader]{pst-fixtransparency.pro}
  /.setfillconstantalpha.bak /.setfillconstantalpha load def
  /.setstrokeconstantalpha.bak /.setstrokeconstantalpha load def
  /.setalphaisshape.bak /.setalphaisshape load def
\end{filecontents}
\begin{filecontents}[overwrite,noheader]{pst-fixtransparency.sty}
  \AtBeginDvi{
  \special{header=pst-fixtransparency.pro}
  \special{!
    /.setfillconstantalpha /.setfillconstantalpha.bak load def
    /.setstrokeconstantalpha /.setstrokeconstantalpha.bak load def
    /.setalphaisshape /.setalphaisshape.bak load def
    /.setopacityalpha {
      dup .setfillconstantalpha .setstrokeconstantalpha} def
    /.setshapealpha {
      dup .setfillconstantalpha .setstrokeconstantalpha
      true .setalphaisshape} def
  }
}
\end{filecontents}
\RequirePackage{pst-fixtransparency}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[varwidth]{standalone}

\usepackage{pstricks-add}

\begin{document}
\psset{fillstyle=solid,linewidth=0.1,opacity=0.4,strokeopacity=0.7}

\begin{pspicture}(-3.48,-3.06)(3.48,3.48)
  \pscircle[fillcolor=green,linecolor=green](2;135){2cm}
  \pscircle[fillcolor=red,linecolor=red](2;45){2cm}
  \pscircle[fillcolor=blue,linecolor=blue](1;-90){2cm}
\end{pspicture}
\end{document}


More information about the PSTricks mailing list.