8

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

4
  • Perhaps you should be using indexed color instead? It looks like you're trying to rip game sprites.
    – bwDraco
    Oct 5, 2015 at 21:45
  • How could I correct the channels with indexed color directly? This is not a palettized sprite, it's a texture in a game specific texture format.
    – Ray
    Oct 5, 2015 at 21:48
  • @RayKoopa I see that you've accepted my answer - but I'd still like to know how the real G and real B channel are treated, you can't map all of them to the new R. Do they get discarded? Oct 7, 2015 at 19:53
  • Ah... yes, this is different. Oct 8, 2015 at 5:56

2 Answers 2

1

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.

8

The necessary tools are in the Colours > Components submenu:

  • The "Channel Mixer" allows to assign linear combinations of all input channels to all output channels. This is the fastest way to swap e.g. red and blue:
    • Select red output channel, configure red to 0% and blue to 100%.
    • Select blue output channel, configure blue to 0% and red to 100%.
    • Apply with "OK".
  • As Michael suggested, one may also decompose the channels and compose them again later, which may open additional possibilities (than just linear combinations).
2
  • Except I don't have a "Colours" menu entry... :-) That worked, although my real issue laid somewhere else. Jul 9, 2021 at 18:03
  • Perfect. I didn't know about that feature. I needed to convert a green cartoon character to a red cartoon character and this did the job. Jun 18 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.