Skip to content

transparency problem #3798

Closed
Closed

Description

@yangleir

Description of the problem

The setting of transparency will affect the pdf figure.
I want to add some text to figure after I set transparency in the previous line. After transforming to PDF, the text will not be shown.
Before the official GMT 6.1, my test is ok. After I update to GMT 6.1, the problem shows up.
The gs version is 9.28 (no bug for transparency ? ).

Full script that generated the error

#!/usr/bin/env bash
#

gmt psbasemap -R2019-03-31T09:00:00/2019-04-01T09:15:00/3/9  -BnSeW -Bpxa4Hf1h -Bsxa1Df1D -Bpya1g1f0.5+l"1 Hz SSH/m" -JX5i/3i -K >swh.ps

echo 2019-03-31T14:20:00 3 >h5.d
echo 2019-03-31T14:20:00 9 >>h5.d
echo 2019-03-31T16:10:00 9 >>h5.d
echo 2019-03-31T16:10:00 3 >>h5.d
gmt psxy  h5.d -R2019-03-31T09:00:00/2019-04-01T09:00:00/3/9 -JX  -W1p,red, -Gred -t90 -O -K >> swh.ps

echo 2019-03-31T11:08:27 3 >h5.d
echo 2019-03-31T11:08:27 9 >>h5.d
echo 2019-03-31T11:12:36 9 >>h5.d
echo 2019-03-31T11:12:36 3 >>h5.d
gmt psxy  h5.d -R2019-03-31T09:00:00/2019-04-01T09:00:00/3/9 -JX  -W1p,green, -Ggreen -t90 -O -K >> swh.ps

echo 2019-03-31T11:08:27 8.5 | gmt pstext -R2019-03-31T09:00:00/2019-04-01T09:00:00/3/9 -J -O -K -F+f10p,5+jBR+t"AIRAS"  >> swh.ps
echo 2019-03-31T16:00:00 8.5 | gmt pstext -R2019-03-31T09:00:00/2019-04-01T09:00:00/3/9 -J -O  -F+f10p,5+jBL+t"BUOY@-1@-@ MOVING"  >> swh.ps

gmt psconvert  swh.ps -P -Tf -A
rm gmt.* *.d

Full error message

# PASTE ERROR MESSAGE HERE

None

Actual outcome

Expected outcome

System information

  • Operating system: MINGW64
  • GMT version (gmt --version): 6.1.0 [64-bit]

Activity

  1. seisman commented on Aug 1, 2020

    @seisman
    Member

    ghostscript never released gs 9.28. Please confirm your gs version by running gs --version.

    This is my output with GMT master + gs 9.50. It looks correct, right?
    image

  2. PaulWessel commented on Aug 1, 2020

    @PaulWessel
    Contributor

    Was just going to post the same result. Most be gs issue.

  3. yangleir commented on Aug 1, 2020

    @yangleir
    Author

    en...
    Could you tell me how to check the gs version under windows(MINGW64)?
    The version 9.28rc is released before 9.50.
    The GMT always give me the information:
    psconvert [WARNING]: Input file has transparency but your gs version 9.51 has a bug preventing it - please downgrade to 9.50

    But I did not use 9.51.

    I am sure this is not gs issue.
    Because if I back to other gmt 6 version before the official release. It work again (means no the above problem).

    Could someone test it under windows (MINGW64)?

  4. seisman commented on Aug 1, 2020

    @seisman
    Member

    Add -Vd to your psconvert command, then you should see some debug messages like

    psconvert [DEBUG]: gmt_check_executable: Pass to popen: [gs --version 2> /dev/null]
    psconvert [DEBUG]: gs --version 2> /dev/null was successful
    psconvert [DEBUG]: Ghostscript version: 9.50
    psconvert [INFORMATION]: Processing swh.ps...
    psconvert [INFORMATION]: Find HiResBoundingBox ...
    

    The version 9.28rc is released before 9.50.

    It's a candidate release. Ghostscript planned to release 9.28 but actually released 9.50 instead.

    The GMT always give me the information:
    psconvert [WARNING]: Input file has transparency but your gs version 9.51 has a bug preventing it - please downgrade to 9.50

    The GMT official Windows installers ship ghostscript which may be newer than 9.50. It's possible that you're running the one shipped with GMT installers.

    I am sure this is not gs issue.
    Because if I back to other gmt 6 version before the official release. It work again (means no the above problem).

    Please attach your PS file and also post your PNG file here, so that we can see what's the problem.

  5. yangleir commented on Aug 1, 2020

    @yangleir
    Author

    OK.
    I found that in the GMT dir, there is gswin*.exe. This is the problem.
    After delete it, the GMT calls my system gs. And it is fine.

    So, it is clear.
    Just a question? Why ship gs under windows, since it is not perfect and always affects the transparency setting.

  6. PaulWessel commented on Aug 1, 2020

    @PaulWessel
    Contributor

    Pretty sure @joa-quim added a working gs; he can address that tomorrow.

  7. yangleir commented on Aug 1, 2020

    @yangleir
    Author

    Thanks @seisman @PaulWessel .
    Have a nice weekend

  8. joa-quim commented on Aug 1, 2020

    @joa-quim
    Member

    Why ship gs under windows, since it is not perfect and always affects the transparency setting.

    That is simply not true. This is what I get with your script. Together with the warning message

    bash scri.sh
    psconvert [WARNING]: Input file has transparency but your gs version 9.51 has a bug preventing it - please downgrade to 9.50
    

    The warning message started to show up when we satarted to check the gs version number. It happens that I built ghostscript from source a little after they released 9.50. At that time the breaking transparency was not yet in the code but the version number had already been increased. We need to do something about it but the shipped in gs has been there since 6.0 and w had no complains so far (not countong this one ofc).

    swh

  9. seisman commented on Aug 1, 2020

    @seisman
    Member

    Compared to my plot in #3798 (comment), the text strings AIRAS and BOUY1MOVING are not plotted.

  10. joa-quim commented on Aug 1, 2020

    @joa-quim
    Member

    Yes, I noticed it but that's separate from transparency

  11. joa-quim commented on Aug 1, 2020

    @joa-quim
    Member

    It's in the PS though, which in gsview6 also displays the transparency.
    Have no time for the moment to explore this further (screen capture from ghostview bellow)

    image

  12. yangleir commented on Aug 2, 2020

    @yangleir
    Author

    Thanks @joa-quim, you got the same result with me. The ps file could show the added text. The pdf converted by psconvert will not show it.
    Exactly,I should say the setting of transparency will affect the psconvert tool. The transparency itself is not affected in the pdf figure. It is the GMT shell lines after setting transparency affected and could not be converted to pdf or png.

    It is related to the GMT build-in gs (official GMT 6.1).

  13. joa-quim commented on Aug 2, 2020

    @joa-quim
    Member

    Yes, something is not working but the distributed GS is exactly the same as it was for 6.0 and you say that it sop working only after 6.1

  14. added
    bug
    on Aug 8, 2020
  15. added this to the 6.1.1 milestone on Aug 8, 2020
  16. seisman commented on Aug 9, 2020

    @seisman
    Member

    For the upcoming GMT 6.1.1 release, I think what we can do is to distribute gs 9.50 in the Windows installers, as gs's master branch also means unstable, and it's annoying to see the psconvert [WARNING]: Input file has transparency but your gs version 9.51 has a bug preventing it - please downgrade to 9.50 even though the gs may work.

  17. joa-quim commented on Aug 20, 2020

    @joa-quim
    Member

    OK, tried with the new 9.53 RC and it works but I also get these weird messages

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

    I say weird because the only place I find reference to that offense in in the source code itself. e.g. in ghostscript\Resource\Init\pdf_main.ps

  18. PaulWessel commented on Aug 20, 2020

    @PaulWessel
    Contributor

    Yes, we will have to rewrite how we use the transparency operators.

  19. seisman commented on Sep 3, 2020

    @seisman
    Member

    We just released GMT 6.1.1, and the Windows installers now ship a working ghostscript. Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions