Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As part of my homework I need to prove or disprove that changing the contrast and than changing the brightness is, or isn't the same as changing the brightness and after that changing the contrast.

let's assume that we are using gray-scale.

brightness - is the mean of the the gray levels.
changing brightness - adding or decreasing a const from every pixel.
contrast - max - min of the gray-scale levels.
changing the contrast - stretching the gray levels around the mean.

I understand that you need to disprove it. but I don't know how to do it in a formal way.

share|cite|improve this question
up vote 2 down vote accepted

Write down brightness and contrast as functions that act on a single gray-scale pixel. As you said, brightness is $b(x) = x + \alpha$ and contrast is $c(x) = \beta(x - x_\text{mean}) + x_\text{mean}$ or something similar. Now all you need to show is that $b \circ c \neq c \circ b$.

share|cite|improve this answer
thanks great explanation. – Gilad Jan 30 '13 at 19:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.