Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion computer_vision/mean_threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""


def mean_threshold(image: Image) -> Image:
def mean_threshold(image: Image.Image) -> Image.Image:
"""
image: is a grayscale PIL image object
"""
Expand All @@ -21,7 +21,7 @@

for j in range(width):
for i in range(height):
pixels[i, j] = 255 if pixels[i, j] > mean else 0

Check failure on line 24 in computer_vision/mean_threshold.py

View workflow job for this annotation

GitHub Actions / ty

ty (invalid-assignment)

computer_vision/mean_threshold.py:24:13: invalid-assignment: Cannot assign to a subscript on an object of type `None` info: The full type of the subscripted object is `PixelAccess | None` info: `None` does not have a `__setitem__` method.
return image


Expand Down
2 changes: 1 addition & 1 deletion computer_vision/otsu_threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""


def otsu_threshold(image: Image) -> Image:
def otsu_threshold(image: Image.Image) -> Image.Image:
"""
Applies Otsu's thresholding method to a grayscale image.

Expand Down
2 changes: 1 addition & 1 deletion digital_image_processing/change_brightness.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from PIL import Image


def change_brightness(img: Image, level: float) -> Image:
def change_brightness(img: Image.Image, level: float) -> Image.Image:
"""
Change the brightness of a PIL Image to a given level.

Expand Down
2 changes: 1 addition & 1 deletion digital_image_processing/change_contrast.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from PIL import Image


def change_contrast(img: Image, level: int) -> Image:
def change_contrast(img: Image.Image, level: int) -> Image.Image:
"""
Function to change contrast
"""
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ rules.deprecated = "ignore"
rules.invalid-argument-type = "ignore"
rules.invalid-return-type = "ignore"
rules.invalid-type-arguments = "ignore"
rules.invalid-type-form = "ignore"
rules.no-matching-overload = "ignore"
rules.not-iterable = "ignore"
rules.not-subscriptable = "ignore"
Expand Down
Loading