sh0dan // VoxPod

Monday, March 14, 2005

More Color Adjustments

So now I got color adjustments done. Brightness, Contrast, Hue and Saturation.

Hue and saturation is done in YUV colorspace, since the RGB->YUV->RGB calculation is a lot faster than RGB->HSV->RGB and the result is the same.

Brightness is a bit interesting, since it's dealing with unclamped values. That means that when brightness is -100%, overexposed areas will still show through. This is one of the niceties of float point arithmetic.

I got a release build working, by disabling Global Optimizations on the problematic routine. Not the ideal solution, as the function is the most critical of them all, since it is the high quality interpolation routine.

Now I'll spare my fingers from further typing tonight, and post the most recent screenshot:


  • Do you need to round-trip through YUV, though, for hue/sat? Saturation adjustment is definitely linear and for that at least you can fold the three matrices together into one transform. Most of your color adjustments would then be a set of dp3s.

    By Blogger Phaeron, at 6:15 am  

  • You are right. My initial though was to use a matrix for H/S adjustments. But since Levels is also on my to-do list, I thought I might as well have a YUV conversion in there, to make it able to preserve luma.

    But when I've got a working implementation os my planned features, I'll begin to look at optimizations, until then I'm only optimizing 'when need', that is when it becoms a serious bottleneck. Until then I'll focus on features and UI.

    By Blogger Klaus Post, at 9:32 pm  

  • Wow..I just tried to play with it and I ended up with the greatest learning which I hadnt done before...Thankyou Klaus..This YUV conversion with the H/S conversions helped me so much....Amazing concept for a rookie like me...

    By Anonymous Motorhome Hire, at 10:12 pm  

Post a Comment

<< Home