Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow grdimage to process byte images without indexed colors, via CPT #7827

Merged
merged 12 commits into from Sep 23, 2023

Conversation

PaulWessel
Copy link
Member

See forum discussion for background. This PR is almost there - 45 minutes of work is not bad. Perhaps @joa-quim knows what to improve. There are an issue to resolve:

The image has values 0-8 for a total of 9, but CPT has 8. Since these are "keys" to categories 1-8 there are only 8 but GMT does not know the image contains categories and not index into a color table. I inserted a 0 row (white) to make this work for now.

Perhaps a 1-byte image without color table is expected to hold categories? If so we can subtract one and be OK

Should not be too hard to fix this but want @joa-quim input on this. See new renderer grdimage_img_byte_index.

t

See forum discussion for background. This PR is almost there but has a 1/3 fraction issue...Perhaps @joa-quim knows what to improve.
@PaulWessel PaulWessel added the enhancement Improving an existing feature label Sep 22, 2023
@PaulWessel PaulWessel added this to the 6.5.0 milestone Sep 22, 2023
@PaulWessel PaulWessel self-assigned this Sep 22, 2023
@joa-quim
Copy link
Member

joa-quim commented Sep 22, 2023

OK, here's how I think this should work

  1. Indexed but no companion colormap. Keep it as we currently do of automatically assign a [0 255] gray scale.
    Spoil users. If max(I) ~< 20 warn the user that he/she might want to use -C.
  2. Indexed, no cmap but -Ccpt. min(I) -> first CPT color, min(I)+1 -> second CPT color and so on until we consume
    all CPT entries. At the end, if number of classes != number of colors, warn user. Note that here if classes do not jump
    by 1 it's likely that the different condition is met. An extra condition here is that the CPT must be using the RGB model.
    That is, no HSV CPTs can be allowed.
  3. Indexed, with cmap and -Ccpt. Do as in 2. and replace previous colors with the new ones in -C.

This, with the example tif file used above would NOT render the expected result, but that is the image's fault.

EDIT: If we have NoDataValue info, that value should not count as class and be assigned the color white.

@PaulWessel
Copy link
Member Author

If the image (via gdalinfo) says NoData is 0, how come our image say header->nan_value = NaN? Must get set somewhere, no?

@joa-quim
Copy link
Member

Yes, should be somewhere in gdalread. Ofc it shouldn't be NaN for an integer type and that's likely an unnoticed bug so far because our use of it has always been for grids where everything ends up as float32.

@PaulWessel
Copy link
Member Author

Note
prhs->N.nan_value
is never set but there are stuff like

dfNoDataValue = GDALGetRasterNoDataValue(hBand, &bGotNoDataValue);

so look maybe we can get it even if not a float or rub grid?

@joa-quim
Copy link
Member

joa-quim commented Sep 22, 2023

It is set in gmtgdalread_get_attrib_from_string() at Ctrl->band_field_names[nBand].nodata but this fun seems to be only called for HDF5 driver and the comment in it not very reassuring

GMT_LOCAL int gmtgdalread_get_attrib_from_string(struct GMT_GDALREAD_OUT_CTRL *Ctrl, GDALRasterBandH hBand, int nBand, double  *dfNoDataValue) {
	/* Since several methods to get band's attributes for HDF5 Datasets are not yet implemented in GDAL2.1.0
	   namely GDALGetRasterScale() and friends, the temporary work-around is to fish them from the Metadata
	   strings that we can access via GDALGetMetadata().
	*/

but it has to be set somewhere else too.

Edit: yes, we can find it in gmtgdalread_populate_metadata().

Ctrl->band_field_names[nBand].nodata = (double)GDALGetRasterNoDataValue(hBand, &status);

So each band has a NoData info.

@PaulWessel
Copy link
Member Author

After latest updates, using this CPT (fix typo, otherwise the same):

1   250/227/156   ;Cropland
2   68/111/51     ;Forest
3   51/160/44     ;Shrub
4   171/211/123   ;Grassland
5   30/105/180    ;Water
6   166/206/227   ;Snow/Ice
7   207/189/163   ;Barren
8   226/66/144    ;Impervious

gmt grdimage LC2013.tif -Cclasscolor.cpt -B -png t

t

Compare with plot at top.

@PaulWessel
Copy link
Member Author

Now doing this check:

	if (gmt_M_is_dnan (Conf->Image->header->nan_value)) /* Nodata not set, offset to 1 if CPT indicates first key is 1 */
		start = (irint (Conf->P->data[0].z_low) == 1) ? 1 : 0;	/* No "0" key in CPT so we skip it */
	else	/* Check if the nan_value is 0 or 255 */
		start = (irint (Conf->Image->header->nan_value) == 0) ? 1 : 0;	/* No "0" key in CPT so we skip it */

and then the node index gets start subtracted so 1 becomes 0, the first category. If 0, or if nan is set then we place the CPT nan color in the output image and we also turn on -Q.

Seems OK?

@joa-quim
Copy link
Member

Shouldn't the else branch also test that Conf->P->data[0].z_low) == 1?

@PaulWessel
Copy link
Member Author

Shouldn't the else branch also test that Conf->P->data[0].z_low) == 1?

Sure, will do that too.

@PaulWessel
Copy link
Member Author

Done.

@PaulWessel PaulWessel changed the title WIP Allow grdimage to process byte images without indexed colors, via CPT Allow grdimage to process byte images without indexed colors, via CPT Sep 23, 2023
@PaulWessel PaulWessel merged commit 18c514e into master Sep 23, 2023
6 checks passed
@PaulWessel PaulWessel deleted the byte-img-map branch September 23, 2023 16:03
@weiji14
Copy link
Member

weiji14 commented Oct 4, 2023

We're getting an error like Error: e [ERROR]: Byte image without indexed color requires a CPT via -C on GMT 6.5.0_5496e05_2023.10.05 when passing in a Byte image with 3 bands. See GenericMappingTools/pygmt#2717 (comment) for details.

Was there some logic added to ensure that only Byte images with a single band require a CPT?

@joa-quim
Copy link
Member

joa-quim commented Oct 4, 2023

Are those 3 bands not part of a RGB image? I mean, are they a pack of 3 indexed images? Does that thing exist in nature?

@weiji14
Copy link
Member

weiji14 commented Oct 4, 2023

We're passing in a GeoTIFF - rgb_image.tif.txt (remove the .txt extension after download). This is the output from grdinfo:

rgb_image.tif: Title: Grid imported via GDAL
rgb_image.tif: Command: 
rgb_image.tif: Remark: 
rgb_image.tif: Pixel node registration used [Cartesian grid]
rgb_image.tif: Grid file format: gd = Import/export through GDAL
rgb_image.tif: x_min: -20116086.8069 x_max: 20116086.8069 x_inc: 157156.928179 name: x n_columns: 256
rgb_image.tif: y_min: -20116086.8069 y_max: 20116086.8069 y_inc: 157156.928179 name: y n_rows: 256
rgb_image.tif: v_min: 1.79769313486e+308 v_max: -1.79769313486e+308 name: z
rgb_image.tif: scale_factor: 1 add_offset: 0
rgb_image.tif: Default CPT: 
+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs

and from gdalinfo:

Driver: GTiff/GeoTIFF
Files: rgb_image.tif
Size is 256, 256
Coordinate System is:
PROJCRS["WGS 84 / Pseudo-Mercator",
    BASEGEOGCRS["WGS 84",
        ENSEMBLE["World Geodetic System 1984 ensemble",
            MEMBER["World Geodetic System 1984 (Transit)"],
            MEMBER["World Geodetic System 1984 (G730)"],
            MEMBER["World Geodetic System 1984 (G873)"],
            MEMBER["World Geodetic System 1984 (G1150)"],
            MEMBER["World Geodetic System 1984 (G1674)"],
            MEMBER["World Geodetic System 1984 (G1762)"],
            MEMBER["World Geodetic System 1984 (G2139)"],
            ELLIPSOID["WGS 84",6378137,298.257223563,
                LENGTHUNIT["metre",1]],
            ENSEMBLEACCURACY[2.0]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4326]],
    CONVERSION["Popular Visualisation Pseudo-Mercator",
        METHOD["Popular Visualisation Pseudo Mercator",
            ID["EPSG",1024]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["False easting",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["easting (X)",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["northing (Y)",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    USAGE[
        SCOPE["Web mapping and visualisation."],
        AREA["World between 85.06°S and 85.06°N."],
        BBOX[-85.06,-180,85.06,180]],
    ID["EPSG",3857]]
Data axis to CRS axis mapping: 1,2
Origin = (-20116086.806878615170717,20116086.806878615170717)
Pixel Size = (157156.928178739181021,-157156.928178739210125)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (-20116086.807,20116086.807) (179d17'38.82"E, 85d 6'41.94"N)
Lower Left  (-20116086.807,-20116086.807) (179d17'38.82"E, 85d 6'41.94"S)
Upper Right (20116086.807,20116086.807) (179d17'38.82"W, 85d 6'41.94"N)
Lower Right (20116086.807,-20116086.807) (179d17'38.82"W, 85d 6'41.94"S)
Center      (   0.0000000,  -0.0000000) (  0d 0' 0.01"E,  0d 0' 0.00"S)
Band 1 Block=256x10 Type=Byte, ColorInterp=Red
Band 2 Block=256x10 Type=Byte, ColorInterp=Green
Band 3 Block=256x10 Type=Byte, ColorInterp=Blue

@joa-quim
Copy link
Member

joa-quim commented Oct 4, 2023

And what is the command that generates that error? When I plot it with GMT.jl default setting it works fine (also shown the GMT generated command that actually does the job)

julia> viz("rgb_image.tiff", Vd=1)
        grdimage  -R-20116086.8068786/20116086.8068786/-20116086.8068786/20116086.8068786 -JX15c/0 -Baf -BWSen -n+a -D -P -K > c:\TMP/GMTjl_j.ps

GMTjl_j

@weiji14
Copy link
Member

weiji14 commented Oct 5, 2023

Ran gmt grdimage rgb_image.tif -Vd -png quick. Here's the debug output:

gmt [DEBUG]: GMT_Create_Session: Terminal width = 190
gmt [DEBUG]: Obtained the ppid from parent: 13262
gmt [DEBUG]: Enter: gmtinit_new_GMT_ctrl
gmt [DEBUG]: GMT->session.SHAREDIR = /home/user/mambaforge/envs/pygmt/share/gmt
gmt [DEBUG]: GMT->session.HOMEDIR = /home/user
gmt [DEBUG]: GMT->session.USERDIR = /home/user/.gmt [created]
gmt [DEBUG]: GMT->session.CACHEDIR = /home/user/.gmt/cache [created]
gmt [DEBUG]: GMT: 0. Will try to find subdir=postscriptlight stem = PSL_custom_fonts suffix=.txt
gmt [DEBUG]: GMT: 1. gmt_getsharepath trying current dir
gmt [DEBUG]: GMT: 2. gmt_getsharepath trying USERDIR /home/user/.gmt
gmt [DEBUG]: GMT: 3. gmt_getsharepath trying USERDIR subdir /home/user/.gmt/postscriptlight
gmt [DEBUG]: GMT: 4. gmt_getsharepath trying SHAREDIR subdir /home/user/mambaforge/envs/pygmt/share/gmt/postscriptlight
gmt [DEBUG]: GMT: 5. gmt_getsharepath trying SHAREDIR /home/user/mambaforge/envs/pygmt/share/gmt
gmt [DEBUG]: GMT: 6. gmt_getsharepath failed
gmt [DEBUG]: Map distance calculation will be Cartesian
gmt [DEBUG]: Exit:  gmtinit_new_GMT_ctrl
gmt [DEBUG]: Enter: New_PSL_Ctrl
gmt [DEBUG]: Exit:  New_PSL_Ctrl
gmt [DEBUG]: Enter: gmt_manage_workflow
gmt [DEBUG]: Exit : gmt_manage_workflow
gmt [DEBUG]: Enter: PSL_beginsession
gmt [DEBUG]: Exit : PSL_beginsession
gmt [DEBUG]: Enter: PSL_setdefaults
gmt [DEBUG]: Exit : PSL_setdefaults
gmt [DEBUG]: Enter: gmtlib_io_init
gmt [DEBUG]: Exit : gmtlib_io_init
gmt [DEBUG]: Enter: gmt_hash_init
gmt [DEBUG]: Exit:  gmt_hash_init
gmt [DEBUG]: Enter: gmt_hash_init
gmt [DEBUG]: Exit:  gmt_hash_init
gmt [DEBUG]: Enter: gmt_reload_settings
gmt [DEBUG]: The PROJ_GEODESIC set to Vincenty
gmt [DEBUG]: Look for file /home/user/gmt.conf
gmt [DEBUG]: Look for file /home/user/.gmt/gmt.conf
gmt [DEBUG]: Look for file /home/user/.gmt/server/gmt.conf
gmt [DEBUG]: Look for file /home/user/.gmt/cache/gmt.conf
gmt [DEBUG]: Could not find file gmt.conf
gmt [DEBUG]: Exit:  gmt_reload_settings
gmt [DEBUG]: Enter: gmtlib_plot_C_format
gmt [DEBUG]: Exit:  gmtlib_plot_C_format
gmt [DEBUG]: Enter: gmtinit_get_history
gmt [DEBUG]: Initialize FFTW with 16 threads.
gmt [DEBUG]: GMT_Create_Session initialized GMT structure
gmt [DEBUG]: Loading core GMT shared library: libgmt.so
gmt [DEBUG]: Shared Library # 0 (core). Path = libgmt.so
gmt [DEBUG]: Loading GMT plugins from: /home/user/mambaforge/envs/pygmt/lib/gmt/plugins
gmt [DEBUG]: Shared Library # 1 (supplements). Path = /home/user/mambaforge/envs/pygmt/lib/gmt/plugins/supplements.so
gmt [DEBUG]: Revised options: quick png
begin [INFORMATION]: Creating a workflow directory /home/user/.gmt/sessions/gmt_session.13262
begin [DEBUG]: The PROJ_GEODESIC set to Vincenty
begin [DEBUG]: Look for file /home/user/gmt.conf
begin [DEBUG]: Look for file /home/user/.gmt/gmt.conf
begin [DEBUG]: Look for file /home/user/.gmt/server/gmt.conf
begin [DEBUG]: Look for file /home/user/.gmt/cache/gmt.conf
begin [DEBUG]: Could not find file gmt.conf
begin [DEBUG]: Set session name to be quick png
begin [DEBUG]: Begin Workflow.  Session ID = 13262. Directory /home/user/.gmt/sessions/gmt_session.13262 created.
begin [DEBUG]: GMT now running in modern mode [Session ID = 13262]
gmt [DEBUG]: Use PS filename /home/user/.gmt/sessions/gmt_session.13262/gmt_0.ps-
gmt [DEBUG]: gmtinit_get_current_panel: No current panel selected so not in subplot mode
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Replace file rgb_image.tif with path rgb_image.tif
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Replace file rgb_image.tif with path rgb_image.tif
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Object ID 0 : Registered Grid File rgb_image.tif as an Input resource with geometry Surface [n_objects = 1]
gmt [DEBUG]: gmtapi_begin_io: Input resource access is now enabled [container]
gmt [DEBUG]: gmtapi_import_grid: Passed ID = 0 and mode = 1
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Calling nc_open on rgb_image.tif, ncid = 0, err = -51
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Calling nc_open on rgb_image.tif, ncid = 0, err = -51
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Calling nc_open on rgb_image.tif, ncid = 0, err = -51
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Calling nc_open on rgb_image.tif, ncid = 0, err = -51
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Calling nc_open on rgb_image.tif, ncid = 0, err = -51
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Calling nc_open on rgb_image.tif, ncid = 0, err = -51
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Calling nc_open on rgb_image.tif, ncid = 0, err = -51
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [DEBUG]: Look for file rgb_image.hdr in /home/user/.gmt
gmt [DEBUG]: Look for file rgb_image.hdr in /home/user/.gmt/cache
gmt [DEBUG]: Look for file rgb_image.hdr in /home/user/.gmt/server
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [INFORMATION]: File rgb_image.tif reads with GDAL driver GTiff
gmt [DEBUG]: Found readable file rgb_image.tif
gmt [INFORMATION]: Cartesian input grid
gmt [INFORMATION]: Cartesian input grid
gmt [DEBUG]: GMT_End_IO: Input resource access is now disabled
gmt [DEBUG]: GMT_Destroy_Data: freed memory for a Grid for object 0
gmt [DEBUG]: gmtlib_unregister_io: Unregistering object no 0 [n_objects = 0]
gmt [DEBUG]: gmtlib_unregister_io: Object no 0 has non-NULL resource pointer
gmt [DEBUG]: Look for file -20116086.80687862/20116086.80687862/-20116086.80687862/20116086.80687862 in /home/user/.gmt
gmt [DEBUG]: Look for file -20116086.80687862/20116086.80687862/-20116086.80687862/20116086.80687862 in /home/user/.gmt/cache
gmt [DEBUG]: Look for file -20116086.80687862/20116086.80687862/-20116086.80687862/20116086.80687862 in /home/user/.gmt/server
gmt [DEBUG]: Modern: Adding -JX15c/15c to options since there is no history available.
gmt [DEBUG]: Revised options: rgb_image.tif -Vd -R-20116086.80687862/20116086.80687862/-20116086.80687862/20116086.80687862 -JX15c/15c
grdimage [DEBUG]: History: Process -R-20116086.80687862/20116086.80687862/-20116086.80687862/20116086.80687862
grdimage [DEBUG]: History: Process -JX15c/15c
grdimage [DEBUG]: Look for file -20116086.80687862/20116086.80687862/-20116086.80687862/20116086.80687862 in /home/user/.gmt
grdimage [DEBUG]: Look for file -20116086.80687862/20116086.80687862/-20116086.80687862/20116086.80687862 in /home/user/.gmt/cache
grdimage [DEBUG]: Look for file -20116086.80687862/20116086.80687862/-20116086.80687862/20116086.80687862 in /home/user/.gmt/server
grdimage [DEBUG]: Got regular w/e/s/n for region (-20116086.80687862/20116086.80687862/-20116086.80687862/20116086.80687862)
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Replace file rgb_image.tif with path rgb_image.tif
grdimage [DEBUG]: Replace file rgb_image.tif with rgb_image.tif
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: rgb_image.tif may be image or grid.  Open via GDAL for checking
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Replace file rgb_image.tif with path rgb_image.tif
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Replace file rgb_image.tif with path rgb_image.tif
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Object ID 1 : Registered Image File rgb_image.tif as an Input resource with geometry Surface [n_objects = 1]
grdimage [DEBUG]: gmtapi_begin_io: Input resource access is now enabled [container]
grdimage [DEBUG]: gmtapi_import_image: Passed ID = 1 and mode = 513
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [INFORMATION]: Cartesian input grid
grdimage [DEBUG]: GMT_End_IO: Input resource access is now disabled
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Calling nc_open on rgb_image.tif, ncid = 0, err = -51
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Calling nc_open on rgb_image.tif, ncid = 0, err = -51
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Calling nc_open on rgb_image.tif, ncid = 0, err = -51
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Calling nc_open on rgb_image.tif, ncid = 0, err = -51
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Calling nc_open on rgb_image.tif, ncid = 0, err = -51
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Calling nc_open on rgb_image.tif, ncid = 0, err = -51
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Calling nc_open on rgb_image.tif, ncid = 0, err = -51
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [DEBUG]: Look for file rgb_image.hdr in /home/user/.gmt
grdimage [DEBUG]: Look for file rgb_image.hdr in /home/user/.gmt/cache
grdimage [DEBUG]: Look for file rgb_image.hdr in /home/user/.gmt/server
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [INFORMATION]: File rgb_image.tif reads with GDAL driver GTiff
grdimage [DEBUG]: Found readable file rgb_image.tif
grdimage [INFORMATION]: Cartesian input grid
grdimage [INFORMATION]: Cartesian input grid
grdimage [ERROR]: Byte image without indexed color requires a CPT via -C
grdimage [DEBUG]: gmtlib_get_graphics_item: Fig: 0 Subplot: 2 Panel: () Inset: 0
grdimage [DEBUG]: No current cpt file found
grdimage [DEBUG]: GMT now running in modern mode [Session ID = 13262]
grdimage [DEBUG]: Revised options: show
end [DEBUG]: End Workflow.  Session ID = 13262. Directory /home/user/.gmt/sessions/gmt_session.13262 removed.
end [DEBUG]: No figure file /home/user/.gmt/sessions/gmt_session.13262/gmt.figures - nothing to do
end [DEBUG]: No figure file /home/user/.gmt/sessions/gmt_session.13262/gmt.figures - nothing to do
end [DEBUG]: Got session name as quick and default graphics formats as png
end [INFORMATION]: Process GMT figure queue: 1 figures found
end [INFORMATION]: Processing GMT figure #0 [quick png ]
end [INFORMATION]: Destroying the current workflow directory /home/user/.gmt/sessions/gmt_session.13262
end [DEBUG]: Delete gmt.conf
end [DEBUG]: Delete gmt.session
grdimage [DEBUG]: gmtlib_garbage_collection: Destroying object: C=0 A=0 ID=1 W=Input F=Image M=File S=Unused P=55776ef21aa0 N=rgb_image.tif
grdimage [DEBUG]: GMTAPI_Garbage_Collection freed 1 memory objects
grdimage [DEBUG]: gmtlib_unregister_io: Unregistering object no 1 [n_objects = 0]
gmt [DEBUG]: Entering GMT_Destroy_Session
gmt [DEBUG]: gmtlib_get_graphics_item: Fig: 0 Subplot: 2 Panel: () Inset: 0

Using gmt --version 6.5.0_5496e05_2023.10.05.

@seisman
Copy link
Member

seisman commented Oct 5, 2023

Our ex52 example also fails with the same error:

bash ex52.sh 
grdgradient [NOTICE]: Remote data courtesy of GMT data server oceania [http://oceania.generic-mapping-tools.org]

grdgradient [NOTICE]: SRTM15 Earth Relief v2.5.5 at 20x20 arc minutes reduced by Gaussian Cartesian filtering (37.1 km fullwidth) [Tozer et al., 2019].
grdgradient [NOTICE]:   -> Download grid file [831K]: earth_relief_20m_p.grd
grdmix [NOTICE]: Remote data courtesy of GMT data server oceania [http://oceania.generic-mapping-tools.org]

grdmix [NOTICE]: Earth Daytime Image at 20x20 arc minutes [NASA image mosaic - Blue Marble].
grdmix [NOTICE]:   -> Download grid file [283K]: earth_day_20m_p.tif
grdmix [NOTICE]: Earth Nighttime Image at 20x20 arc minutes [NASA image mosaic - Black Marble].
grdmix [NOTICE]:   -> Download grid file [258K]: earth_night_20m_p.tif
grdimage [ERROR]: Byte image without indexed color requires a CPT via -C

PaulWessel added a commit that referenced this pull request Oct 5, 2023
Need to ensure that the image has only one band and no indexed color.  Closes #7827.
PaulWessel added a commit that referenced this pull request Oct 5, 2023
Need to ensure that the image has only one band and no indexed color.  Closes #7827.
@maxrjones maxrjones added the add-changelog Add PR to the changelog label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add-changelog Add PR to the changelog enhancement Improving an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants