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

Function brightness

digital_image_processing/change_brightness.py:9–14  ·  view source on GitHub ↗

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

(c: int)

Source from the content-addressed store, hash-verified

7 """
8
9 def brightness(c: int) -> float:
10 """
11 Fundamental Transformation/Operation that'll be performed on
12 every bit.
13 """
14 return 128 + level + (c - 128)
15
16 if not -255.0 <= level <= 255.0:
17 raise ValueError("level must be between -255.0 (black) and 255.0 (white)")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected