Dumb question, but I've searched everywhere and found nothing specific: is it possible for HSB values to translate directly into a colour (eg. a hue of zero equals red) instead of passing them through an RBG conversion? Also, dumber: I'm not understanding the arrrays people are using, for example here and here.

Thanks for any help.

Recommended Answers

All 3 Replies

Hi,
If you need RGB values of pixel you can get them straight away, without any conversion. The way its done and you might know this already.. You read an image into a bufferedImage and after that you can get RGB values just by using getRGB(x_value,y_value). Let me know if you need help because i have done image processing in JAVA.

Dumb question, but I've searched everywhere and found nothing specific: is it possible for HSB values to translate directly into a colour (eg. a hue of zero equals red) instead of passing them through an RBG conversion?

See Color.getHSBColor(float,float,float)

Also, dumber: I'm not understanding the arrrays people are using, for example here and here.

Some of the methods take a three or four element array for the component values (rgb, rgba, hsb, etc) such as this one Color.RGBtoHSB(int,int,int,float[]) Read the API docs for the details on the parameter and return values for the methods you are wanting to use. The array sizes and ordering area specified.

Thank you! Can't believe I missed the API thing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.