@@ -303,8 +303,10 @@ def grdcontour(self, grid, **kwargs):
303
303
304
304
@fmt_docstring
305
305
@use_alias (
306
+ A = "img_out" ,
306
307
B = "frame" ,
307
308
C = "cmap" ,
309
+ D = "img_in" ,
308
310
E = "dpi" ,
309
311
I = "shading" ,
310
312
J = "projection" ,
@@ -360,8 +362,36 @@ def grdimage(self, grid, **kwargs):
360
362
----------
361
363
grid : str or xarray.DataArray
362
364
The file name of the input grid or the grid loaded as a DataArray.
365
+ img_out : str
366
+ ``out_img[=driver]``.
367
+ Save an image in a raster format instead of PostScript. Use
368
+ extension .ppm for a Portable Pixel Map format which is the only
369
+ raster format GMT can natively write. For GMT installations
370
+ configured with GDAL support there are more choices: Append
371
+ *out_img* to select the image file name and extension. If the
372
+ extension is one of .bmp, .gif, .jpg, .png, or .tif then no driver
373
+ information is required. For other output formats you must append
374
+ the required GDAL driver. The driver is the driver code name used
375
+ by GDAL; see your GDAL installation's documentation for available
376
+ drivers. Append a **+coptions** string where options is a list of
377
+ one or more concatenated number of GDAL **-co** options. For
378
+ example, to write a GeoPDF with the TerraGo format use
379
+ ``=PDF+cGEO_ENCODING=OGC_BP``. Notes: (1) If a tiff file (.tif) is
380
+ selected then we will write a GeoTiff image if the GMT projection
381
+ syntax translates into a PROJ syntax, otherwise a plain tiff file
382
+ is produced. (2) Any vector elements will be lost.
363
383
{B}
364
384
{CPT}
385
+ img_in : str
386
+ ``[r]``
387
+ GMT will automatically detect standard image files (Geotiff, TIFF,
388
+ JPG, PNG, GIF, etc.) and will read those via GDAL. For very obscure
389
+ image formats you may need to explicitly set **img_in**, which
390
+ specifies that the grid is in fact an image file to be read via
391
+ GDAL. Append **r** to assign the region specified by **region**
392
+ to the image. For example, if you have used ``region='d'`` then the
393
+ image will be assigned a global domain. This mode allows you to
394
+ project a raw image (an image without referencing coordinates).
365
395
dpi : int
366
396
``[i|dpi]``.
367
397
Sets the resolution of the projected grid that will be created if a
0 commit comments