Skip to main content

RGB to HSV and back...

1 reply [Last post]
ndesk1900
Offline
Joined: 2008-07-29

Hi all,

Problem at hand: I have an RGB (Buffered) Image. I need to run a convolution filter on the HSV version of it, and finally convert it back to RGB. I'm having some issues in the conversion to HSV.

public BufferedImage toHsvImage(BufferedImage src) {
ColorSpace hsvCol = ColorSpace.getInstance(ColorSpace.TYPE_GRAY);
ColorConvertOp op = new ColorConvertOp(hsvCol, null);
return op.filter(src, null);
}

I also wrote similar code to convert back to RGB. However, when i tried running this code i got an error saying: 'Exception: java.lang.IllegalArgumentException: Unknown color space'.

Could someone suggest a way to convert ColorSpace's correctly (or help me solve the above problem somehow).??

Thanks in advance...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Rafael Santos

Hello,
> Problem at hand: I have an RGB (Buffered) Image. I need to run a convolution filter on the HSV version of it, and finally convert it back to RGB. I'm having some issues in the conversion to HSV.
>
This may help:
http://www.lac.inpe.br/~rafael.santos/JIPCookbook/6320-howto-pansharpeni...

Rafael

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net