-
Notifications
You must be signed in to change notification settings - Fork 382
Use modern gs transparency command #4464
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
Conversation
Yet, we check if our gs is old and if so we stitch in the older transparency command. At some point we should remove that crutch. Closes #4453.
And manually editing the PS and putting back the old command gives the correct answer. Since all our plotting commands are between the two PSL_transp calls I wonder if they have a bug... |
The problem is that the old .setopacityalpha has been replaced with two settings: .setfillconstantalpha and .setstrokeconstantalpha. So, there are actually two options facing us:
I am not sure when this is useful but I note that the gs developers felt this is useful. Perhaps fading a color in a polygon but leaving lines solid is not a bad idea, so I think option 2 is better - but requires gs 9.53 of course to have an effect. |
Following up on last post, there are actually several issues to decide here going forward: A. Backwards compatibility
B. New features As discussed, extend the syntax for -t to now be -t[ftransp[/stransp]][+s][+f] where
|
Note that our transparency macro supports both ghostscript and Adobe Destiller:
and looking (again) and the pdfmark documentation I can now remember that CA and ca sets the two different types of transparencies and we are just duplicating them (dup) since we only pass on number to PSL_transp. Going forward, we will need to pass two numbers in order to set different values, e.g.,
I think a first step is simply to change the macro to take two numbers and then change the code that writes these commands to write two numbers (duplicates). Then the above enhancements can take place next. Information on pdfmark can be found here. The example they give on top of page 41 is actually what we get (using the path twice) in GMT, so perhaps we need to be more careful when transparency applies to both path and fill. |
I have implemented the dual transparencies and fixed the PSL_transp macro for gs 9.53. I also let psconvert handle version mismatches on the fly: New PS with old gs as well as Old PS (our PS origs) and new gs. I have tested the transparency for both ghostscript 9.53 and 9.50 and Adobe Distiller as well as none available, so the new macro works. I have updated the docs and codes and all tests pass. I will need help with the new explain_-tv.rst_ and explain_-tv_full.rst_ since the link from the synopsis do not work and I get
Please give the update GMT PS a spin. |
These two commands give me the same figures:
|
Thanks, I can see why and will fix shortly. |
Needed to add a few missing checks.
Try these and contrast:
|
Or your original examples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but also see the tiny fixes in my previous review.
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
For @joa-quim : This PR prevents those warnings when gs 9.53 is run on previously built PS made before this PR, such as our PS originals in GitHub. |
The warning is because, |
OK, yes, the other _full are included by gmt.rst but here -t is slightly different in the -tv. Is there a way to include it but not show it? Or perhaps just include full in the three module rst files instead of the short one? |
Perhaps that is the best solution so it is clear without clicking that see more link that there are a few changes here. |
Sounds OK to me. |
Yet, we check if our gs is old and if so we stitch in the older transparency command. At some point we should remove that crutch. Closes #4453.