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.

If a 24bit RGB image with a range of 0-255 per channel is displayed on a television that displays a range of approx. 16-235 per channel, color detail will be lost, correct?

If so, should images be pre-processed to only store a valid range? I would like to do this with code, not in a picture editing application. I vaguely recall reading that a linear mapping is not the best way to do this, but unfortunately I can't locate the article I was reading! What is this process called? What other details do I need to know?

share|improve this question

2 Answers 2

up vote 8 down vote accepted

Some color data will be lost or changed regardless of your texture format. However, a bigger problem will be gamma correction. Gamma correction can be a tricky subject since your game will not appear visually the same across all display technologies and finding a single solution is not going to be easy.

These might help you out:

share|improve this answer
    
Thanks for the links. I am already doing gamma correction at load time with libpng, which helps, but I might have to look again at the code after reading the above information as the images are still 'washed out' on a television. –  DrTwox Oct 10 '10 at 3:47

Linear mapping is probably not the best solution (which I believe involves converting your RGB to a CIE colorspace, scaling there, and converting back), but it is very easy to implement, and the range difference is small enough it probably won't matter.

If you use SOIL, it can automatically do this when loading the image, by passing SOIL_FLAG_NTSC_SAFE_RGB to the load functions.

Microsoft's documentation says to clamp, and recommends doing it in a pixel shader. (Linear scaling should also be easy in one.) It also mentions chroma crawl, which in my experience is a much more annoying phenomenon when working on TV displays.

share|improve this answer
    
SOIL! I forgot about that library. It has helped me in the past with some ideas. Thanks for the links. –  DrTwox Oct 11 '10 at 6:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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