GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — Figure.image: Add the parameter 'invert' for option -I by seisman · Pull Request #4089 · GenericMappingTools/pygmt Conversation
|
| invert | ||
| Invert 1-bit image before plotting, i.e., black pixels (on) becomes white (off) | ||
| and vice versa. Ignored if used with color images. |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hm, just trying this and maybe I am missing something here. I thought the remote raster image "vader1.png" is such a 1-bit image (see the last example at https://docs.generic-mapping-tools.org/dev/image.html#examples), but using I=True does not flip the black and white pixels as expected:
import pygmt fig = pygmt.Figure() fig.basemap(region=[-5, 5] * 2, projection="X3c/1c", frame=0) fig.image(imagefile="@vader1.png", position="jLM") fig.image(imagefile="@vader1.png", position="jMC", bitcolor=["gray+f", "blue+b"]) fig.image(imagefile="@vader1.png", position="jRM", I=True) # Does not do something # fig.image(imagefile="@vader1.png", position="jRM", bitcolor=["black+f", "white+b"]) fig.show()
Same for
gmt image @vader1.png -I -png image_I_gmt
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hmm, it looks like an upstream bug.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I tested it with the gmt dev version, and still no inverted colors. Thus, I wrote an issue report at GenericMappingTools/gmt#8795.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The upstream bug has been fixed.
I've added a note in the docstrings.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
196f51b to
40b3933
Compare
40b3933 to
22ac054
Compare
There was an error while loading. Please reload this page.
Co-authored-by: Michael Grund <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.