views:

396

answers:

3

I need to take a BufferedImage and convert it to YCbCr format so that I can do a more efficient Brightness/contrast manipulation on it, but I can't figure out how to do this. I've tried ColorConvertOp but there doesn't seem to be an appropriate ColorSpace for YCbCr (though there is a type for it?).

I could do the conversion manually (the conversion is not difficult) but this would immediately kick my image out of the 'fast-path'. Does anyone know a solution?

+1  A: 

I am not familiar with YCbCr, I just saw (in Wikipedia) it is used by Jpeg images... Intuitively, should I play with brightness, I would have used HSB instead.

I see that's what Jerry does with him Java Image Filters (HSBAdjustFilter). The source is available, perhaps you can find an idea there.

In any case, showing us what you have tried so far might help us to help you...

PhiLho
+1  A: 

Check JAI, http://java.sun.com/javase/technologies/desktop/media/jai/ it can do that and much more.

Maybe you can do the conversion with plain java.awt.color.ColorSpace, but I usually use JAI when I need to deal with image processing.

Davide
A: 

Unfortunately im trying to steer clear of JAI as much as possible, because the application im working on is supposed to target 64 bit windows. and JAI doesn't have native support (and the pure java performance is not acceptable)

luke
Luke, you should not write such an answer to your own questions (in which you just clarify the question itself). Next time, add a comment to my answer and edit your question, instead. Have you tried the plain java.awt.color.ColorSpace I mentioned?
Davide