(img, addition=0, threshold=128)
| 83 | |
| 84 | |
| 85 | def SolarizeAdd(img, addition=0, threshold=128): |
| 86 | img_np = np.array(img).astype(np.int) |
| 87 | img_np = img_np + addition |
| 88 | img_np = np.clip(img_np, 0, 255) |
| 89 | img_np = img_np.astype(np.uint8) |
| 90 | img = Image.fromarray(img_np) |
| 91 | return PIL.ImageOps.solarize(img, threshold) |
| 92 | |
| 93 | |
| 94 | def Posterize(img, v): # [4, 8] |
nothing calls this directly
no outgoing calls
no test coverage detected