1414
1515@fmt_docstring
1616@use_alias (D = "position" , G = "bitcolor" )
17- def image (
17+ def image ( # noqa: PLR0913
1818 self ,
1919 imagefile : PathLike ,
20- projection : str | None = None ,
21- region : Sequence [float | str ] | str | None = None ,
2220 box : Box | bool = False ,
2321 monochrome : bool = False ,
22+ invert : bool = False ,
23+ projection : str | None = None ,
24+ region : Sequence [float | str ] | str | None = None ,
2425 verbose : Literal ["quiet" , "error" , "warning" , "timing" , "info" , "compat" , "debug" ]
2526 | bool = False ,
2627 panel : int | Sequence [int ] | bool = False ,
27- transparency : float | None = None ,
2828 perspective : float | Sequence [float ] | str | bool = False ,
29+ transparency : float | None = None ,
2930 ** kwargs ,
3031):
3132 r"""
@@ -48,6 +49,7 @@ def image(
4849
4950 $aliases
5051 - F = box
52+ - I = invert
5153 - J = projection
5254 - M = monochrome
5355 - R = region
@@ -62,8 +64,6 @@ def image(
6264 An Encapsulated PostScript (EPS) file or a raster image file. An EPS file must
6365 contain an appropriate BoundingBox. A raster file can have a depth of 1, 8, 24,
6466 or 32 bits and is read via GDAL.
65- $projection
66- $region
6767 position : str
6868 [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ **+r**\ *dpi*\
6969 **+w**\ [**-**]\ *width*\ [/*height*]\ [**+j**\ *justify*]\
@@ -85,6 +85,15 @@ def image(
8585 monochrome
8686 Convert color image to monochrome grayshades using the (television)
8787 YIQ-transformation.
88+ invert
89+ Invert 1-bit image before plotting, i.e., black pixels (on) become white (off)
90+ and vice versa. Ignored if used with color images.
91+
92+ **Note**: There was an upstream GMT bug, so this feature may not work correctly
93+ for some 1-bit images for GMT<=6.6.0.
94+ See `PR #8837 <https://github.com/GenericMappingTools/gmt/pull/8837>`__.
95+ $projection
96+ $region
8897 $verbose
8998 $panel
9099 $perspective
@@ -95,6 +104,7 @@ def image(
95104 aliasdict = AliasSystem (
96105 F = Alias (box , name = "box" ),
97106 M = Alias (monochrome , name = "monochrome" ),
107+ I = Alias (invert , name = "invert" ),
98108 ).add_common (
99109 J = projection ,
100110 R = region ,
0 commit comments