NaN Transparency Issues in makecpt Grayscale Plots

In our lab we have a GMT code that creates grayscale plots that just recently stopped working. Instead of making the NaN values transparent, which it used to do just fine, it instead makes the background bright red. Simplified code attached below. (Yes, I’ve checked the input file “corr_ll.grd” for errors, everything is fine there - whatever input file is used, the same problem with NaN grayscale transparency still occurs)

gmt makecpt -Cgray -T0.00/1.00/0.01 -Z > corr.cpt
gmt grdimage corr_ll.grd -Ccorr.cpt -Jx1id -P -Y2i -X2i -Q -V > corr_ll.ps

When this code is run, grdimage gives the following flag:

grdimage [INFORMATION]: Your image is gray scale only but -Q requires building a 24-bit image; your image will be expanded to 24-bit.

I’ve tested other color scales on makecpt, and “gray” is the only one that has this issue - the above flag is not raised for any other color scale but “gray” , and other color scales seem to have no problem with transparency. I believe I know why - the default COLOR_NAN is hsv 128/128/128, which is gray, causing -Q to not be able to distinguish between NaNs and data. It never had this problem before, but I imagine some Ghostscript update must’ve changed something.

So, does anyone know how to fix this issue? Is anyone else having this issue? It’s not a major problem, we could just stop using grayscale plots, but it’s pretty annoying, and I’ve been trouble shooting with makecpt commands for a day now.

Any help would be appreciated.

UPDATE: For anyone else having this issue, we found a fix. This changes the .cpt file to work properly with grdimage’s -Q command:

gmt makecpt -Cgray -T0.00/1.00/0.05 -Z -M --COLOR_NAN=red > corr.cpt

EDIT: fixed some typos

Do you get a message like this one when run grdimage?

Output grid extrema [-10.3922/2478.79] exceeds extrema of input grid [42/2471]; to clip output use -n...+c

What changed that could explain this change in behavior? A GMT update?

We (the GMTSAR team) have no idea. I’m still running GMT 6.5.0 on this machine, so I doubt it has to do with a GMT update. My hunch is it has something to do with Ghostscript (I’m currently using v10.05) - it’s the only thing that updates frequently that I imagine could possibly interfere with plotting. I don’t know though - all I know is that little more than a month ago our code worked fine, and now it doesn’t. This fix I posted works for us just fine though

Strange that it would be a GS thing, but we had so many shits with GS in the past that it might be.

And that INFORMATION notice also started showing up recently? Because that is clearly a GMT printed info.