# Contrast vs. Brightness question

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.

-

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$.