# How to clip image to region of interest?

**URL:** <https://forum.generic-mapping-tools.org/t/how-to-clip-image-to-region-of-interest/658>\
**Category:** Q&A\
**Tags:** gmt\
**Created:** [July 13, 2020, 2:52am UTC](https://forum.generic-mapping-tools.org/t/how-to-clip-image-to-region-of-interest/658 "2020-07-13T02:52:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Octopus](https://avatars.discourse-cdn.com/v4/letter/o/ebca7d/32.png) [@Octopus](https://forum.generic-mapping-tools.org/u/Octopus)\
**Post date:** [July 13, 2020, 2:52am UTC](https://forum.generic-mapping-tools.org/t/how-to-clip-image-to-region-of-interest/658/1 "2020-07-13T02:52:32Z")

</div>

Hello everyone. I am fresh to GMT. I have a global grid and overlay it on a base map using grdimage, I know pscoast -S or -G can clip the image using the coastline, but that’s global coastline. Nevertheless, I only want to show the image in my region of interest, saying, Greenland, and show the base map outside of Greenland. How to achieve that? Thanks.

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [July 13, 2020, 9:19am UTC](https://forum.generic-mapping-tools.org/t/how-to-clip-image-to-region-of-interest/658/2 "2020-07-13T09:19:10Z")

</div>

Hi @Octopus, I’m not sure that I fully understood your question but if clipping is what you are seeking, there is this GMT module `psclip` that may help you.

---

<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:** [July 13, 2020, 9:49am UTC](https://forum.generic-mapping-tools.org/t/how-to-clip-image-to-region-of-interest/658/3 "2020-07-13T09:49:06Z")

</div>

Try using pscoast -EGL -M \> greenland.txt  
and use that with psclip to set up a clip path.

---

<div class="post-metadata">

**Author:** ![Octopus](https://avatars.discourse-cdn.com/v4/letter/o/ebca7d/32.png) [@Octopus](https://forum.generic-mapping-tools.org/u/Octopus)\
**Post date:** [July 14, 2020, 9:34pm UTC](https://forum.generic-mapping-tools.org/t/how-to-clip-image-to-region-of-interest/658/4 "2020-07-14T21:34:32Z")

</div>

Thanks @pwessel @Joaquim, I successfully clipped the image using psclip, with clipping path generated from pscoast -EGL -M \> greenland.txt.  
However, I have another question on the cpt. I will open a new thread on that.
