Do you have lots of these? Ofnuts method is general and will work with a variety of images.
For simple image as given:
1. Filters -> Generic -> Dilate will tend to overwrite the black grid.
screenshot: https://i.imgur.com/OB9wQBI.jpg
2. Image -> Mode -> Indexed with the number of colours set to the number of colours in the image to reduce to those colours. Hopefully that works, otherwise it becomes a matter of editing the colormap.
https://i.imgur.com/Yu4jJ3B.jpg
3. Assuming it works easily, that will Export to a .png file "as-is" or back to RGB mode for inclusion in a larger image. Again Export that as a png.
https://i.imgur.com/cky5wB4.jpg
edit: your image using above.
For simple image as given:
1. Filters -> Generic -> Dilate will tend to overwrite the black grid.
screenshot: https://i.imgur.com/OB9wQBI.jpg
2. Image -> Mode -> Indexed with the number of colours set to the number of colours in the image to reduce to those colours. Hopefully that works, otherwise it becomes a matter of editing the colormap.
https://i.imgur.com/Yu4jJ3B.jpg
3. Assuming it works easily, that will Export to a .png file "as-is" or back to RGB mode for inclusion in a larger image. Again Export that as a png.
https://i.imgur.com/cky5wB4.jpg
edit: your image using above.