Cosmoteer saves a ship's information into the ship images using Stenography (https://en.wikipedia.org/wiki/Steganography).
Details regarding how specifically this is done has been previously specified by Walt (see https://blog.cosmoteer.net/2012/01/starwright-steganography.html).
So if we want to change the ship image but still have it load into Cosmoteer as a valid ship we just need to avoid altering the least significant bit of each of the images color channels.
Now we could write a program to accomplish this but instead I'll describe using an image editor, specifically GIMP (https://www.gimp.org/), to do this. Why? I thought it would be more fun to describe this way.
Part I: Extracting the data from a Cosmoteer Ship
I'll use the following ship as a running example,

After loading in the ship image into the image editor we first will change the alpha channel (which is currently making much of the image transparent).
Go to the Channels dialog (Windows - Dockable Dialogs - Channels) select the layer named 'Alpha' and fill it black, so that none of the image is transparent.
We now will zero all of the color channel bits except for the least significant one; which holds the ship's data. How? We will duplicate the ship image, zero the least significant bit using underflow and then subtract it from the original ship image.
Even if that made absolutely no sense it is probably still possible to mechanically do the following:
- Go to the Layers dialog (Windows - Dockable Dialogs - Layers) duplicate the one layer containing the ship image (right click layer - Duplicate Layer).
- Set the foreground color to hex color code 7f7f7f (in toolbox left click the color box and in the 'Change Foreground Color' dialog put that hex color code in the HTML notation box).
- Create 2 new layers above the top layer using foreground color (right click top layer - New Layer: Layer Fill Type: Foreground color).
- Set the top most new layer's mode to 'Divide' and the one below it to 'Multiple' (layer mode is at top of Layers dialog). Then merge down these two layers into the top ship image (right click layer - Merge Down).
- Set the top ship image mode to difference and merge it down.
There should now be 1 layer left that appears completely back.
However, it still contains the ships data. Saving the (seemly solid back) image as a .png file and test that it still loads into Cosmoteer as the original ship.

Or it can be checked by the following:
- Set the foreground color to black (hex code 000000).
- Create a new layer with this foreground color.
- Set the layer's mode to divide.
The result should be something like this,

What this check does is it makes the least significant bit the most significant when everything else is zero.
We now have eliminate most of the original ship image.
Part II: Merging Cosmoteer Ship data with another image
Now we will load in the image that we want to merge with the ship data and modify it so that it can be merged without corrupting the ship data.
(Note: I'll assume that the image to merge has already been scaled to be 512x512 so that it is the same size as the ship image.)
I'll use the following image to show that the entire ship image can altered.

Use File - Open as Layers to load it it into the same project as the remains of the ship image.
We now will zero all least significant channel bits for the image that is to be merged using basically the same steps as in Part I.
- Set the foreground color to hex color code 7f7f7f (in toolbox left click the color box and in the 'Change Foreground Color' dialog put that hex color code in the HTML notation box).
- Create 2 new layers above the top layer using foreground color (right click top layer - New Layer: Layer Fill Type: Foreground color).
- Set the top most new layer's mode to 'Divide' and the one below it to 'Multiple' (layer mode is at top of Layers dialog).
- Make sure that image to be merged with the ship data is above the remains of the ship image layer then merge down the two layers created above (right click layer - Merge Down).
Now there should only be the layer containing the image to be merged left and the remains of the ship image layer.
Set the image to be merged mode to 'Addition' and merge it down.
And that is it. Save the resulting image as a .png file and it will load into Cosmoteer.

Hopefully this can be followed by anyone that has a creative use for this and is willing to put in some effort while still being hard enough that people don't start using it for random things.