Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2011-07-25 23:11:16

freddyG
Member
Registered: 2011-07-25
Posts: 1

Brightness values to db values conversion

Hi,


I wonder if you can help me with this:

I've taken brightness values from a picture using photoshop. These values range from 0 to 255.

I want to turn these values into db which in this case ranges from -100 to 0.

For example, if I get a value of 65 in brightness how can i turn it into a db value ?

Is there a way of doing this ?

Thanks

Offline

#2 2011-07-25 23:43:05

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Brightness values to db values conversion

Hi;

Are those integers? If not...

If you want your db's to be integers as I suspect your brightness' are then you will have to put up with some collisions of values. Meaning you can not squeeze 256 values into 101 boxes without there being more than one in some boxes.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#3 2011-07-26 00:01:27

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: Brightness values to db values conversion

Hi freddyG,

A formula like this?

y in "db" and x is the brightness.


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#4 2011-07-26 02:29:05

Bob
Administrator
Registered: 2010-06-20
Posts: 10,053

Re: Brightness values to db values conversion

hi freddyg

I may be off on a tangent here but 'db' stands for decibels and is usually used for sound measurements (but Wiki says also in electronics).

In an on-line search for 'photoshop' and 'db' I came up with lots of help on converting databases into photoshop and back.

The relationship may not be linear.

So, if the above answers aren't what you were looking for,  maybe you need to say more fully what you are trying to do.

Is this for a second piece of software?

Are you trying to compare the brightness level of one point in a photo with another?

Or what?

Bob

Last edited by Bob (2011-07-26 02:30:10)


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#5 2011-07-27 03:34:32

TMorgan
Member
Registered: 2011-04-13
Posts: 25

Re: Brightness values to db values conversion

Hi Freddy,
  dB is by definition a ratio. The ratio has to be to a reference value. Since you are looking for negative values the reference will be the max value, 255. The equation for dB for a power quantity is

dB = 10 log P/P(ref)

10dB represents a ratio of 10:1, 20dB = 100:1, 30dB = 1000:1 ...

Your value of 65 gives a dB value of 10*log(65/255) = -5.94

The scale will not go down to -100 since that would require a ratio of 10^10 to 1. Your max ratio is 255:1. An intensity of 1 will give your lowest dB value of -24.1.

Hope this helps. Wikepedia also has a pretty good description.
Note the case of the letters, deci is a prefix that means 1/10, as always. A decibel is 1/10 of a Bel, an old unit that is no longer used. But since it was named after a person the B is upper case, but the d is not.

Offline

#6 2011-07-28 01:03:40

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Brightness values to db values conversion

Hi freddyG;

I have just noticed that you have posted this same problem on other forums. I should tell you what a waste of effort that is having several people reduplicate work. A very good moderator I know will not even allow a post that has been posted elsewhere. I sometimes wish that I were him.

In addition you seem to have replied to everyone else. That I do not understand. All the people on this forum are volunteers. Their time is limited and they deserve not to have their time wasted.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

Board footer

Powered by FluxBB