Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparency problem #155

Closed
oguibe opened this issue Apr 28, 2020 · 3 comments
Closed

Transparency problem #155

oguibe opened this issue Apr 28, 2020 · 3 comments

Comments

@oguibe
Copy link

oguibe commented Apr 28, 2020

Hello
With Asymptote (svn version or Texlive 2020) under Debian Sid with Ghostscript 9.52 there is (again) a transparency problem.

unitsize(1cm);

fill(shift(1.5dir(120))*unitcircle,green+opacity(0.75));
fill(shift(1.5dir(60))*unitcircle,red+opacity(0.75));
fill(unitcircle,blue+opacity(0.75));
label("Asymptote",shift(1.5dir(270))*(0,0));

asy -f pdf does not produce any transparency.
Also under Ubuntu https://tex.stackexchange.com/questions/540807/no-transparency-with-asymptote

Thanks for advance

@asmwarrior
Copy link

I'm using the Asymptote 2.65 and Ghostscript 9.50 under Windows7(64bit).
Your code gives such result pdf. It looks like transparency works OK, but the circles are a bit lower as expected.
See the attached pdf.
2020-04-29.pdf

@bgvoisin
Copy link

bgvoisin commented May 24, 2020

Just a heads-up (I don't use Asymptote myself, but I deal with Ghostscript for the team preparing MacTeX – the Mac version of TeX Live – every year, and Mojca Miklavec pointed at the possible consequences for Asymptote): there are two separate Ghostscript issues with transparency.

First 9.27 (4 April 2019) changed the security restrictions of Ghostscript, so that the operators .setopacityalpha and .setshapealpha were considered unsafe and required -dNOSAFER. Made aware of the issue, Chris Liddell (one of the Ghostscript developers) implemented -dALLOWPSTRANSPARENCY, which restores the two operators while keeping the other security restrictions in place. This was shortly after the release of 9.50 (15 October 2019).

Then the last two releases, 9.51 (12 March 2020) and 9.52 (19 March 2020) have started reimplementing transparency, in such a way that .setopacityalpha and .setshapealpha no longer worked. This was reported in Bugzilla, and resulted in a decision (in the current development code for 9.53) to deprecate these operators and replace them by .setfillconstantalpha and .setstrokeconstantalpha, which work a bit differently. The issue was at

https://bugs.ghostscript.com/show_bug.cgi?id=702219

the commit is at

http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=d12d2085b5bd08ca1e813d97f3f7f7e630e791a0

and the documentation is getting updated to reflect the changes

https://www.ghostscript.com/doc/current/Language.htm#Transparency

A few days ago, Chris Liddell posted a message to the gs-devel list

https://ghostscript.com/pipermail/gs-devel/2020-May/010295.html

making the change official, announcing that there will backward-compatible support of the old operators (.setopacityalpha and .setshapealpha) in terms of the new operators (.setfillconstantalpha and .setstrokeconstantalpha) for at least the next two releases (9.53 and 9.54), and inviting affected developers to interact with him if need be.

@johncbowman
Copy link
Member

Thank you for the helpful information; these changes are now committed as 0fcf4e5. Once again, the Ghostscript developers have without warning forced a backwards incompatible change on us...

Despite what the documentation says, it seems that in the current version, gs 9.52,
-dALLOWPSTRANSPARENCY is required regardless of whether -dNOSAFER or -dSAFER is specified.

This change breaks the use of opacity on older versions of ghostscript (like 9.26), so unfortunately everyone who wants to use opacity in PDF files is forced to upgrade ghostscript to version 9.52:

https://www.ghostscript.com/download/gsdnld.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants