Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions pygmt/src/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@

@fmt_docstring
@use_alias(D="position", G="bitcolor")
def image(
def image( # noqa: PLR0913
self,
imagefile: PathLike,
projection: str | None = None,
region: Sequence[float | str] | str | None = None,
box: Box | bool = False,
monochrome: bool = False,
invert: bool = False,
projection: str | None = None,
region: Sequence[float | str] | str | None = None,
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
| bool = False,
panel: int | Sequence[int] | bool = False,
transparency: float | None = None,
perspective: float | Sequence[float] | str | bool = False,
transparency: float | None = None,
**kwargs,
):
r"""
Expand All @@ -48,6 +49,7 @@ def image(

$aliases
- F = box
- I = invert
- J = projection
- M = monochrome
- R = region
Expand All @@ -62,8 +64,6 @@ def image(
An Encapsulated PostScript (EPS) file or a raster image file. An EPS file must
contain an appropriate BoundingBox. A raster file can have a depth of 1, 8, 24,
or 32 bits and is read via GDAL.
$projection
$region
position : str
[**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ **+r**\ *dpi*\
**+w**\ [**-**]\ *width*\ [/*height*]\ [**+j**\ *justify*]\
Expand All @@ -85,6 +85,15 @@ def image(
monochrome
Convert color image to monochrome grayshades using the (television)
YIQ-transformation.
invert
Invert 1-bit image before plotting, i.e., black pixels (on) become white (off)
and vice versa. Ignored if used with color images.

**Note**: There was an upstream GMT bug, so this feature may not work correctly
for some 1-bit images for GMT<=6.6.0.
See `PR #8837 <https://github.com/GenericMappingTools/gmt/pull/8837>`__.
$projection
$region
$verbose
$panel
$perspective
Expand All @@ -95,6 +104,7 @@ def image(
aliasdict = AliasSystem(
F=Alias(box, name="box"),
M=Alias(monochrome, name="monochrome"),
I=Alias(invert, name="invert"),
).add_common(
J=projection,
R=region,
Expand Down