Skip to content

Commit 22ac054

Browse files
committed
Figure.image: Add the alias 'invert' for option -I
1 parent be792c3 commit 22ac054

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pygmt/src/image.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414

1515
@fmt_docstring
1616
@use_alias(D="position", G="bitcolor")
17-
def image(
17+
def image( # noqa: PLR0913
1818
self,
1919
imagefile: PathLike,
2020
projection: str | None = None,
2121
region: Sequence[float | str] | str | None = None,
2222
box: Box | bool = False,
2323
monochrome: bool = False,
24+
invert: bool = False,
2425
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
2526
| bool = False,
2627
panel: int | Sequence[int] | bool = False,
@@ -48,6 +49,7 @@ def image(
4849
4950
$aliases
5051
- F = box
52+
- I = invert
5153
- J = projection
5254
- M = monochrome
5355
- R = region
@@ -85,6 +87,13 @@ def image(
8587
monochrome
8688
Convert color image to monochrome grayshades using the (television)
8789
YIQ-transformation.
90+
invert
91+
Invert 1-bit image before plotting, i.e., black pixels (on) becomes white (off)
92+
and vice versa. Ignored if used with color images.
93+
94+
**Note**: There was an upstream GMT bug, so this feature may not work correctly
95+
for some 1-bit images for GMT<=6.6.0.
96+
See `PR #8837 <https://github.com/GenericMappingTools/gmt/pull/8837>`__.
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

Comments
 (0)