You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compatibility with the old .setopacityalpha and new .setfillconstantalpha/.setalphaisshape PostScript #4453
The issue was discussed in another issue #3282. Here I open a separate issue for better discussions.
Just build their master branch. The transparency bug in 9.51 and 9.52 is fixed. Now I can see transparency in PDF, JPG and PNG.
However, I get the following warnings for transparent plots:
**** WARNING: .setopacityalpha is deprecated (as of 9.53) and will be removed in a future release
**** See .setfillconstantalpha/.setalphaisshape for the improved solution
This is a threat for us, so we need to figure out how to rewrite the PSL_transp PostScript function that is defined in the PSL_strings.h include file. I have yet to find any documentation on .setfillconstantalpha and how to use it. Just replacing .setopacityalpha with . setfillconstantalpha did not seem to wark (no errors, but no transparency). We will need to research this more to better document how we do this, possibly asking the gs people for advice.
Yes. So we cannot drop it in yet, but also cannot wait until they drop support. I guess we need a way to issue the right code based on gs version. Have to think about how that should be done, maybe with a bit-flag passed into PSL_plotinit.
This is gs 9.53.3. Perhaps @seisman's earlier experiment was with an earlier (and not yet working) version? It seems we should be able to finesse this in the code since we check on gs version and just need to use the older scheme for older versions for awhile. OK?
Given that only psconvert checks for gs version, perhaps the solution should be applied there. Given the version we can intercept the .setfillconstantalpha word and replace with .setopacityalpha if version is < 9.53. That way no need to have every GMT process check gs version.
That is true if we do what I suggested. There are no scenarios were everything will work for all. We could leave the PS as is and only update psconvert in 6.2.0 to do the switch if 9.53 is detected. However, anyone running 6.1.1 with an updated gs 9.53 will also have trouble. So two options it seems:
Change master PS code to use . setfillconstantalpha but let psconvert possibly change that to .setopacityalpha if old gs detected. After some time (or perhaps never) we remove that check.
Leave master PS code with .setopacityalpha but let psconvert possibly change that to . setfillconstantalpha if gs is 9.53 or newer. At some future time (or perhaps never) we update the PS and remove the check.
I can imagine there are people who will get into trouble in both scenarios, and obviously sharing PS files (like your example) may be a problem. Seems to me that we should fix the PS to be compliant but let psconvert help during the transition. Better to have a PS compliant with current gs I think. Do you have better arguments?
Activity
PaulWessel commentedon Nov 18, 2020
We have one PostScript function we call PSL_transp that looks like this:
and we call it when needed (e.g., like this to set red (1 0 0 ) with 60% transparency using normal blend mode:)
{1 0 0 C 0.6 /Normal PSL_transp} FSThis works but 9.53 gives those ugly warnings. If I change it to this it still works (and no warnings):
This is gs 9.53.3. Perhaps @seisman's earlier experiment was with an earlier (and not yet working) version? It seems we should be able to finesse this in the code since we check on gs version and just need to use the older scheme for older versions for awhile. OK?
PaulWessel commentedon Nov 18, 2020
Given that only psconvert checks for gs version, perhaps the solution should be applied there. Given the version we can intercept the .setfillconstantalpha word and replace with .setopacityalpha if version is < 9.53. That way no need to have every GMT process check gs version.
seisman commentedon Nov 18, 2020
I can confirm that changing
.setopacityalphato.setfillconstantalphaworks.If I generate a PS file using GMT 6.2.0, others who uses <=GMT 6.1.1 and gs<9.53 won't be able to convert it to other formats, right?
PaulWessel commentedon Nov 19, 2020
That is true if we do what I suggested. There are no scenarios were everything will work for all. We could leave the PS as is and only update psconvert in 6.2.0 to do the switch if 9.53 is detected. However, anyone running 6.1.1 with an updated gs 9.53 will also have trouble. So two options it seems:
I can imagine there are people who will get into trouble in both scenarios, and obviously sharing PS files (like your example) may be a problem. Seems to me that we should fix the PS to be compliant but let psconvert help during the transition. Better to have a PS compliant with current gs I think. Do you have better arguments?
seisman commentedon Nov 19, 2020
Yes, I agree.
use modern gs transparency command
Use modern gs transparency command (#4464)