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.