Question

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?

Was it helpful?

Solution

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...

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top