MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / contrast

Function contrast

digital_image_processing/change_contrast.py:20–25  ·  view source on GitHub ↗

Fundamental Transformation/Operation that'll be performed on every bit.

(c: int)

Source from the content-addressed store, hash-verified

18 factor = (259 * (level + 255)) / (255 * (259 - level))
19
20 def contrast(c: int) -> int:
21 """
22 Fundamental Transformation/Operation that'll be performed on
23 every bit.
24 """
25 return int(128 + factor * (c - 128))
26
27 return img.point(contrast)
28

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected