Remove clutter
This commit is contained in:
parent
c2f2b183aa
commit
7b4397f66c
1 changed files with 1 additions and 2 deletions
|
|
@ -3,9 +3,8 @@ from PIL import Image
|
|||
|
||||
|
||||
def add_noise(img: Image, alpha: float) -> Image:
|
||||
img = img.convert("RGB")
|
||||
width, height = img.size
|
||||
random_colors = np.random.randint(0, 256, (height, width, 3), dtype=np.uint8)
|
||||
random_img = Image.fromarray(random_colors, mode="RGB")
|
||||
random_img = Image.fromarray(random_colors)
|
||||
result = Image.blend(img, random_img, alpha)
|
||||
return result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue