Java RGB to HSB Conversion: An Introduction

  • Thread starter Thread starter internet user
  • Start date Start date
  • Tags Tags
    Introduction
AI Thread Summary
The discussion centers on the differences between RGB and HSB color models and the process of converting between them, particularly in Java programming. RGB (Red, Green, Blue) is an additive color model, while HSB (Hue, Saturation, Brightness) represents colors in a way that aligns more closely with human perception. A key point raised is that conversions between RGB and HSB cannot be exact due to the nature of the models; for instance, when saturation (S) is zero in HSB, the hue (H) becomes irrelevant, as all shades of grey are represented by the same value. This indicates that there are more RGB values than HSB values for any given bit depth, complicating the conversion process. A Java code example for conversion is referenced, highlighting practical implementation.
internet user
Messages
1
Reaction score
0
I came across HSB for the first time when I was reading a guide on Java. What is the difference between the two, and how do you convert from RGB to HSB (and vice versa)?
 
Technology news on Phys.org
Q: How do I do this thing?
A: Like this: public class DoThisThing extends Applet{

Hmmm...

It occurs to me that such conversions can't be exact. in HSB, if S=0, then H becomes irrelevant. No matter what value is in H, the exact same shade of grey is defined. Because there is no RGB equivalent to this, there are more RGB values then HSB values for any given bit depth.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top