diff --git a/hakuimg/blend.py b/hakuimg/blend.py index f1bf076..86c66b0 100644 --- a/hakuimg/blend.py +++ b/hakuimg/blend.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from PIL import Image, ImageFilter, ImageColor import numpy as np diff --git a/hakuimg/blur.py b/hakuimg/blur.py index a6a9cf5..5b22413 100644 --- a/hakuimg/blur.py +++ b/hakuimg/blur.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from PIL import Image, ImageFilter diff --git a/hakuimg/color.py b/hakuimg/color.py index 4e5c123..7cc45b1 100644 --- a/hakuimg/color.py +++ b/hakuimg/color.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from PIL import Image, ImageEnhance import cv2 import numpy as np diff --git a/hakuimg/dither.py b/hakuimg/dither.py index eb73248..7690b58 100644 --- a/hakuimg/dither.py +++ b/hakuimg/dither.py @@ -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) \ No newline at end of file + 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) \ No newline at end of file diff --git a/hakuimg/pixel.py b/hakuimg/pixel.py index 3522d0d..7e32479 100644 --- a/hakuimg/pixel.py +++ b/hakuimg/pixel.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from typing import Any from numpy.typing import NDArray diff --git a/hakuimg/sketch.py b/hakuimg/sketch.py index 66bf655..6fe2cc0 100644 --- a/hakuimg/sketch.py +++ b/hakuimg/sketch.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from PIL import Image, ImageFilter, ImageEnhance, ImageColor import cv2 import numpy as np diff --git a/inoutpaint/main.py b/inoutpaint/main.py index 152cb96..5680993 100644 --- a/inoutpaint/main.py +++ b/inoutpaint/main.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import numpy as np import cv2 from PIL import Image diff --git a/inoutpaint/utils.py b/inoutpaint/utils.py index 82eed63..8d67159 100644 --- a/inoutpaint/utils.py +++ b/inoutpaint/utils.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import numpy as np import cv2 from PIL import Image