Wanderer
Wanderer

Reputation: 476

Calculate brighness, contrast, hue and saturation level in an image using java

How can we calculate the brightness, contract, hue and saturation numbers in an image using java programming. Any formula, code snippet appreciated.

Upvotes: 1

Views: 5426

Answers (2)

coder hacker
coder hacker

Reputation: 4868

You can use HSV model to calculate the values, where H is Hue, S is saturation and V is value( or brightness)

enter image description here

enter image description here

enter image description here

Here RGB are the Red, Green and Blue value of pixel which I am assuming you are able to read with help of some image processing library.

Upvotes: 5

Dropout
Dropout

Reputation: 13866

This might be difficult to implement using only native Java libraries, however you might be interested in some 3rd party library like for example ImageJ which enables you to control contrast, brigthness and so on. There are also a couple of examples on the aformentioned page.

Upvotes: 0

Related Questions