Swap RGBA channels around in Gimp

colorsgimpimage editing

I have a weird texture format of a game which stores the RGB color and alpha channel in an uncommon way like this:

  • Real R maps to game's R
  • Real G maps to game's R
  • Real B maps to game's R
  • Real A maps to game's G

Thus, it basically can only contain grayscale (R channel) and alpha information (in the B channel). The G and A channels can be safely ignored.
Is it possible to remap the color channels and alpha channel in Gimp accordingly?

This is the input image:

badly mapped triforce

Best Answer

In general, the Decompose and Compose filters may be able to do this.

Decomposes can split an image into grayscale images or layers for the R, G, B and A component.

Compose allows to use grayscale images or layers for the R, G, B and A component of a new image.

For the new G and A, you probably want to use either plain white or black.

You will have to clarify how you expect more than one component to be mapped to the new R, though.

Related Question