Contrast vs brightness vs gamma

23 次查看(过去 30 天)
Please help, somebody in here can explain about picture i sent
  2 个评论
Rik
Rik 2019-12-13
What exactly is your question? It also doesn't look like a Matlab question to me.
Nayuta Altria
Nayuta Altria 2019-12-13
I want know difference contrast and brightness from that chart

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2019-12-13
编辑:Image Analyst 2019-12-13
Those charts are a mapping of output gray level versus input gray level. A linear 45 degree line means that the output is the same as the input. Changing brightness is like raising or lowering the line so the output is brighter or darker than the input. Changing contrast is changing the slope of the line, which controls the range of the values, so like an input range of 100-120 (very narrow low contrast image) can be mapped to 0-255 (a much wider range and more contrasty image). Changing gamma is related to how much it emphasizes different ranges. If it goes up and flattens out (gamma charts on the left) the dark input range is expanded (making it more visible) while the bright contrast range is compressed. This is good for making dark parts of the image more visible. If the curve curves the other way, it makes the bright parts more visible and compresses the range of the dark parts of the image.
  2 个评论
Image Analyst
Image Analyst 2019-12-13
You're welcome. Thanks for Accepting this answer. I wish there was a more interactive way to just draw whatever curve you want and see the result but I don't think there is.

请先登录,再进行评论。

更多回答(1 个)

DGM
DGM 2022-3-23
Regarding visualization, I find that it's helpful to use flat-shaded contour maps to represent the shift in values. At least I find it more intuitive than a set of line plots, given that the contour map is essentially a test image itself.
It's worth noting that different tools implement these adjustments differently. The nature of the parameters is often limited by a need to make them controllable via GUI sliders with finite extents. Consider a basic brightness-contrast-gamma adjustment scheme similar to that described in the question. Herein, brightness and contrast controls have a range of [-1 1], whereas gamma ranges from [0 Inf]. As the contour plots indicate, the null condition occurs when these three parameters are [0 0 1].
Note that brightness is purely additive; unless truncation occurs in a region of interest, local contrast is preserved. On the other hand, contrast changes slope with a midpoint pivot; local contrast is directly altered, but the global mean doesn't shift. Gamma shifts the distribution up or down without moving the endpoints of the curve, meaning black and white don't change.
Again, implementations vary. Consider as an example, the Brightness & Contrast adjustment tool used by GIMP. In this implementation, contrast behaves the same as above, but brightness is a piecewise function:
While this avoids the truncation of image values, it also means that the brightness control is also a contrast control. Raising or lowering brightness reduces both local and global contrast. In my opinion, it makes the tool confusing to use -- but it's an extant convention in a particular context.
Attached is a simple demo that allows the user to explore these behaviors.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by