Let annotations work

pull/21/head
Kohaku-Blueleaf 2023-01-24 03:13:03 +08:00
parent 29bf1be3f8
commit ecda22390d
8 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,5 @@
from __future__ import annotations
from PIL import Image, ImageFilter, ImageColor
import numpy as np

View File

@ -1,3 +1,5 @@
from __future__ import annotations
from PIL import Image, ImageFilter

View File

@ -1,3 +1,5 @@
from __future__ import annotations
from PIL import Image, ImageEnhance
import cv2
import numpy as np

View File

@ -1,3 +1,5 @@
from __future__ import annotations
from typing import Any
from numpy.typing import NDArray
@ -28,4 +30,12 @@ def dithering(
new_res[i+1, j-1] += err * 3/16
if j < d_w - 1:
new_res[i+1, j+1] += err * 1/16
return np.clip(new_res/np.max(new_res, axis=(0,1))*255, 0, 255)
return np.clip(new_res/np.max(new_res, axis=(0,1))*255, 0, 255)
def run(
src,
k: int = 3,
) -> tuple[Image.Image, list[list[str|float]]]:
def calc()
return Image.fromarray(result)

View File

@ -1,3 +1,5 @@
from __future__ import annotations
from typing import Any
from numpy.typing import NDArray

View File

@ -1,3 +1,5 @@
from __future__ import annotations
from PIL import Image, ImageFilter, ImageEnhance, ImageColor
import cv2
import numpy as np

View File

@ -1,3 +1,5 @@
from __future__ import annotations
import numpy as np
import cv2
from PIL import Image

View File

@ -1,3 +1,5 @@
from __future__ import annotations
import numpy as np
import cv2
from PIL import Image