Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

share|improve this question

migrated from photo.stackexchange.com Jan 13 '11 at 5:47

This question came from our site for professional, enthusiast and amateur photographers.

closed as off topic by Tetrad Aug 11 '11 at 16:20

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
@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. –  ysap Jan 12 '11 at 17:05
2  
This seems like it might be a game programmming question, not a photography question. –  mattdm Jan 12 '11 at 20:14
    
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. –  Jari Komppa Jan 14 '11 at 10:39
    
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). –  Jari Komppa Mar 14 '11 at 10:19
1  
I can't see how this is a game development question. –  CiscoIPPhone Apr 13 '11 at 9:53
show 1 more comment

1 Answer 1

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.

share|improve this answer
add comment