Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

png_image.sh 575 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  1. #!/usr/bin/env bash
  2. #
  3. # Testing gmt grdimage with a PNG
  4. gmt begin png_image ps
  5. gmt grdmath -R0/5/0/5 -I1 -r X DUP UPPER DIV 255 MUL = r.grd
  6. gmt grdmath Y DUP UPPER DIV 255 MUL = g.grd
  7. gmt grdmath 5 X SUB 5 Y SUB MUL DUP UPPER DIV 255 MUL = b.grd
  8. gmt grdmix r.grd g.grd b.grd -N -C -Grgb.png
  9. # Lay down Cartesian image
  10. gmt grdimage rgb.png -JX8c/0 -B0
  11. # Lay down Cartesian image
  12. gmt grdimage rgb.png -JX-8c/-8c -B0 -X9c
  13. # Pretend it is geographic
  14. gmt grdimage rgb.png -JM8c -R0/30/35/65 -B0 -X-9c -Y10c
  15. gmt grdimage rgb.png -Ei -B0 -X9c
  16. rm -f ?.grd
  17. gmt end show
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...