Let annotations work
parent
29bf1be3f8
commit
ecda22390d
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from PIL import Image, ImageFilter, ImageColor
|
||||
import numpy as np
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from PIL import Image, ImageFilter
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from PIL import Image, ImageEnhance
|
||||
import cv2
|
||||
import numpy as np
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
from numpy.typing import NDArray
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from PIL import Image, ImageFilter, ImageEnhance, ImageColor
|
||||
import cv2
|
||||
import numpy as np
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import numpy as np
|
||||
import cv2
|
||||
from PIL import Image
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import numpy as np
|
||||
import cv2
|
||||
from PIL import Image
|
||||
|
|
|
|||
Loading…
Reference in New Issue