MATLAB: Write a program to change brightness and change the contrast of the color image (keep the average brightness of the image). I don’t understand how to keep the average brightness of the image. thank you!!!

color spaceimage processingImage Processing Toolbox

"Write a program to change brightness and change the contrast of the color image (keep the average brightness of the image)."
I don't understand how to keep the average brightness of the image. thank you!!!

Best Answer

The way to keep the average brightness of an image is:
  1. calculate the average brightness of the original image; Call this BRorig
  2. make whatever local changes to color and contrast;
  3. calculate the average brightness of the revised image; Call this BRnew
  4. multiply the revised image by the ratio BRorig/BRnew