Suppose I've a picture, which want to achieve day/light mode by changing 8bpp color palette.

If I want the pixel index of my picture is always fixed for both day mode and night mode. For example, the 1st pixel index is 100. Which I can look up index 100 in day mode palette and night mode palette. How can I use GIMP to do so? My goal is to not update my pixel index of my picture.

Also, as you see in two palette, they are not one one mapping. That is index 1 of the day mode palette and index 1 of the night mode palette may not used in the same pixel of the picture, how can I tackle this problem?

Actually, my use case is as follow I want to use one 8bpp picture to achieve day/night mode by update only the color palette (without updating the pixel index). The advantage is I only have to prepare 2 256 byte palette rather than saving 2 big pictures in my limited data ram.

Thanks a lot

  • \$\begingroup\$ @J.C., welcome to the community. The two images, although look similar, actually differ in the contents of their pixels. By this I mean that if the day picture actually uses all the colors in the palette, then there are pixel values that are not representable in the night image. \$\endgroup\$
    – ysap
    Jan 12 '11 at 17:05
  • 2
    \$\begingroup\$ This seems like it might be a game programmming question, not a photography question. \$\endgroup\$
    – mattdm
    Jan 12 '11 at 20:14
  • \$\begingroup\$ From a glance, it seems like the images are more or less monochromatic, with one using a color ramp tinted to red and the other tinted to blue. So, I'd store the image as greyscale and alter the palette accordingly at runtime. \$\endgroup\$ Jan 14 '11 at 10:39
  • \$\begingroup\$ In any case I wonder where the two images came from.. you probably want to alter your content production pipeline so that the palettes do match (i.e, make the second image by altering the palette of the first). \$\endgroup\$ Mar 14 '11 at 10:19
  • 1
    \$\begingroup\$ I can't see how this is a game development question. \$\endgroup\$ Apr 13 '11 at 9:53

When I want to change the color balance on an entire image like is being done in the example, I tend to use the Color Balance tool, which is one of the simplest ways the shift colors throughout a selected area.

There are also a few other tools that you can use to fine tune the color in your images.