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

Function normalize

digital_image_processing/sepia.py:22–24  ·  view source on GitHub ↗

Helper function to normalize R/G/B value -> return 255 if value > 255

(value)

Source from the content-addressed store, hash-verified

20 return 0.2126 * red + 0.587 * green + 0.114 * blue
21
22 def normalize(value):
23 """Helper function to normalize R/G/B value -> return 255 if value > 255"""
24 return min(value, 255)
25
26 for i in range(pixel_h):
27 for j in range(pixel_v):

Callers 1

make_sepiaFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected