move files
This commit is contained in:
parent
1a41fd6829
commit
231e22cac8
36 changed files with 15580 additions and 79653 deletions
14
src/editor/utils/apply_pixel_shader.py
Normal file
14
src/editor/utils/apply_pixel_shader.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
from typing import Callable, Tuple
|
||||
from PIL import Image
|
||||
|
||||
|
||||
def apply_pixel_shader(
|
||||
img: Image, callback: Callable[[int, int, int], Tuple[int, int, int]]
|
||||
):
|
||||
width, height = img.size
|
||||
pixels = img.load()
|
||||
for x in range(width):
|
||||
for y in range(height):
|
||||
r, g, b = pixels[x, y]
|
||||
pixels[x, y] = callback(r, g, b)
|
||||
return img
|
||||
Loading…
Add table
Add a link
Reference in a new issue