You are not logged in.
Pages: 1
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
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
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
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
Offline
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
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
Pages: 1