# Transparency option is not working both for makecpt and grdimage

**URL:** <https://forum.generic-mapping-tools.org/t/transparency-option-is-not-working-both-for-makecpt-and-grdimage/3697>\
**Category:** Q&A\
**Tags:** gmt, cpt, color\
**Created:** [February 21, 2023, 8:15am UTC](https://forum.generic-mapping-tools.org/t/transparency-option-is-not-working-both-for-makecpt-and-grdimage/3697 "2023-02-21T08:15:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![piyushether](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/piyushether/32/87_2.png) [@piyushether](https://forum.generic-mapping-tools.org/u/piyushether)\
**Post date:** [February 21, 2023, 8:15am UTC](https://forum.generic-mapping-tools.org/t/transparency-option-is-not-working-both-for-makecpt-and-grdimage/3697/1 "2023-02-21T08:15:03Z")

</div>

Hi, I am trying to apply transparency for `makecpt` and `grdimage`, but there is no effect. Following is my code. As I know, modern GMT can apply transparency only on pdf, but in my case, I applied for several image formats, including pdf, ps, jpg, and png, but I didn’t get much success. In addition, I am using an external cpt file here, but I also tried with the default cpt files of GMT. Is there any issue with MacOS? I am using GMT 6.4.0 on Macbook Pro. I used a similar option in the previous version with Linux, which worked perfectly.

```
gmt begin mean_no2_new pdf A+m0.1c,E900 -C

j=-JM8
r=-R-105/-101/30.8/33.2
cpt=f-33-13-10.cpt

gmt makecpt -T-0.2/4.5/0.01 -C$cpt -A50+a -H -D -M > map.cpt
gmt grdimage grdfile.nc $j $x $y -BWSne -Cmap.cpt -t50
gmt coast -Df -Wthin -Na/0.5
gmt colorbar -DjBL+o9.2c/0.5c+w4.5c/0.35+ma -Cmap.cpt

gmt end
```

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [February 21, 2023, 9:43am UTC](https://forum.generic-mapping-tools.org/t/transparency-option-is-not-working-both-for-makecpt-and-grdimage/3697/2 "2023-02-21T09:43:06Z")

</div>

Perhaps your ghostscript (gs) has been updated to 10 and then you need to run GMT from the latest source since 6.5 is not yet out. I think that is what is happening. Many of us use macOS and no problem but 6.4 does not expect gs 10.

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [February 21, 2023, 9:43am UTC](https://forum.generic-mapping-tools.org/t/transparency-option-is-not-working-both-for-makecpt-and-grdimage/3697/3 "2023-02-21T09:43:52Z")

</div>

Alternatively, step back to gs 9.54 or whatever the last one was.

---

<div class="post-metadata">

**Author:** ![piyushether](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/piyushether/32/87_2.png) [@piyushether](https://forum.generic-mapping-tools.org/u/piyushether)\
**Post date:** [February 21, 2023, 12:27pm UTC](https://forum.generic-mapping-tools.org/t/transparency-option-is-not-working-both-for-makecpt-and-grdimage/3697/4 "2023-02-21T12:27:06Z")

</div>

> [@piyushether](#):
>
> `-t50`

Thanks, @pwessel. I step back to `gs 9.56.1`, and it works now. However, I have seen that when I applied transparency to `makecpt`. It can be visualized in the colorbar, but the same cpt with transparency applied to the `grdimage` is not visualized in the end product. Although I can use `-t50` on `grdimage`, I am curious to know why a cpt generated with transparency is not working on the `grdimage`. I attached an end plot here. I am using the above code without `-t50` in the `grdimage` line.

 ![test_plot](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/8/8b63f5bd17a54fe8c3ef972dda6d0b3130e1c047.png)
