Hello
What format are you using for saving? JPEG ?
Some image file formats has a special field in their header, which is set to
1 for grayscale images, for example (or a special flag). In the case you
even don't need to write your palette to the file. So, I suppose, that you
saved your image as an ordinary 8 bpp indexed imaged, with a palette of
grayscale gradients. Yes, your image looks grayscale, but Gimp thinks it's
not, because it seeing a palette and does not analyze it.
I have similar issue with my image processing library. I was loading
grayscale JPEG, but GDI+ was creating just 8 bpp indexed image and there was
no any chance to resolve if the image is grayscale. So, I am analyzing
palette of 8 bpp indexed images, to resolve if it's grayscale or colored.
Hope you will find the way.