From 1f8dc444c6a33460fbf258264ae481703046b6a5 Mon Sep 17 00:00:00 2001 From: Kieran W <41634689+FredHappyface@users.noreply.github.com> Date: Fri, 19 Jan 2024 20:59:39 +0000 Subject: [PATCH] rel 2024.0.1 --- .pre-commit-config.yaml | 57 +++---- CHANGELOG.md | 5 + blendmodes/__init__.py | 2 +- blendmodes/blend.py | 14 +- blendmodes/imagetools.py | 25 +--- documentation/reference/blendmodes/blend.md | 140 +++++++++++++++--- .../reference/blendmodes/blendtype.md | 4 +- .../reference/blendmodes/imagetools.md | 55 ++----- documentation/reference/blendmodes/index.md | 3 +- pyproject.toml | 72 ++++----- requirements.txt | 5 +- tests/__init__.py | 1 - tests/test_main.py | 64 ++++---- 13 files changed, 251 insertions(+), 196 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e9129f0..b19c635 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,44 +1,49 @@ repos: - - repo: https://github.com/FHPythonUtils/Blackt - rev: '2022.0.3' + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.14 hooks: - - id: blackt + - id: ruff + args: [ --fix ] + + - repo: https://github.com/RobertCraigie/pyright-python + rev: v1.1.347 + hooks: + - id: pyright - - repo: https://github.com/pycqa/isort - rev: 5.12.0 + - repo: https://github.com/FHPythonUtils/Blackt + rev: '2024.0.1' hooks: - - id: isort + - id: blackt - - repo: https://github.com/pycqa/pylint - rev: v3.0.0a6 + - repo: https://github.com/Lucas-C/pre-commit-hooks-safety + rev: v1.3.2 hooks: - - id: pylint - exclude: "tests/" - args: [--disable=import-error,--jobs=0] + - id: python-safety-dependencies-check + files: pyproject.toml - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - exclude: "tests/" - id: end-of-file-fixer - exclude: "tests/" + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-json + - id: check-merge-conflict + - id: check-shebang-scripts-are-executable + - id: check-symlinks + - id: check-toml + - id: check-vcs-permalinks + - id: check-yaml + - id: detect-private-key + - id: mixed-line-ending - - repo: https://github.com/asottile/pyupgrade - rev: v3.7.0 - hooks: - - id: pyupgrade - args: [--py38-plus] - repo: https://github.com/boidolr/pre-commit-images - rev: v1.2.1 + rev: v1.5.1 hooks: - - id: optimize-avif - exclude: "tests/" - id: optimize-jpg - exclude: "tests/" - id: optimize-png - exclude: "tests/" - id: optimize-svg - exclude: "tests/" - id: optimize-webp - exclude: "tests/" + +exclude: "tests/data|documentation/reference" diff --git a/CHANGELOG.md b/CHANGELOG.md index dd3acfd..4108da0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All major and minor version changes will be documented in this file. Details of patch-level version changes can be found in [commit messages](../../commits/master). +## 2024.0.1 - 2024/01/19 + +- update dependencies +- ruff linting + ## 2024 - 2024/01/07 - update dependencies diff --git a/blendmodes/__init__.py b/blendmodes/__init__.py index 295e3ff..de3bff6 100644 --- a/blendmodes/__init__.py +++ b/blendmodes/__init__.py @@ -1,2 +1,2 @@ -"""Use this module to apply a number of blending modes to a background and foreground image +"""Use this module to apply a number of blending modes to a background and foreground image. """ diff --git a/blendmodes/blend.py b/blendmodes/blend.py index b713211..4c5b5f0 100644 --- a/blendmodes/blend.py +++ b/blendmodes/blend.py @@ -281,9 +281,9 @@ def destin( Destination which overlaps the source, replaces the source. - Fa = 0; Fb = αs - co = αb x Cb x αs - αo = αb x αs + Fa = 0; Fb = as + co = ab x Cb x as + ao = ab x as """ del foregroundColour # Not used by function outAlpha = backgroundAlpha * foregroundAlpha @@ -361,9 +361,11 @@ def imageIntToFloat(image: np.ndarray) -> np.ndarray: """Convert a numpy array representing an image to an array of floats. Args: + ---- image (np.ndarray): numpy array of ints Returns: + ------- np.ndarray: numpy array of floats """ return image / 255 @@ -373,9 +375,11 @@ def imageFloatToInt(image: np.ndarray) -> np.ndarray: """Convert a numpy array representing an image to an array of ints. Args: + ---- image (np.ndarray): numpy array of floats Returns: + ------- np.ndarray: numpy array of ints """ clippedIm = np.clip((image * 255).round(), 0, 255) @@ -388,11 +392,13 @@ def blend(background: np.ndarray, foreground: np.ndarray, blendType: BlendType) """Blend pixels. Args: + ---- background (np.ndarray): background foreground (np.ndarray): foreground blendType (BlendType): the blend type Returns: + ------- np.ndarray: new array representing the image background: np.ndarray, @@ -457,12 +463,14 @@ def blendLayers( """Blend layers using numpy array. Args: + ---- background (Image.Image): background layer foreground (Image.Image): foreground layer (must be same size as background) blendType (BlendType): The blendtype opacity (float): The opacity of the foreground image Returns: + ------- Image.Image: combined image """ # Convert the Image.Image to a numpy array diff --git a/blendmodes/imagetools.py b/blendmodes/imagetools.py index cecc7fd..3612a81 100644 --- a/blendmodes/imagetools.py +++ b/blendmodes/imagetools.py @@ -2,38 +2,16 @@ """ from __future__ import annotations -import warnings - -from deprecation import deprecated from PIL import Image -@deprecated(deprecated_in="2021.1", removed_in="", details="use renderWAlphaOffset") -def rasterImageOA( # pylint:disable=missing-function-docstring - image: Image.Image, size: tuple[int, int], alpha: float = 1.0, offsets: tuple[int, int] = (0, 0) -) -> Image.Image: - warnings.warn( - "Call to deprecated function rasterImageOA.", category=DeprecationWarning, stacklevel=2 - ) - return renderWAlphaOffset(image, size, alpha, offsets) - - -@deprecated(deprecated_in="2021.1", removed_in="", details="use renderWAlphaOffset") -def rasterImageOffset( # pylint:disable=missing-function-docstring - image: Image.Image, size: tuple[int, int], offsets: tuple[int, int] = (0, 0) -) -> Image.Image: - warnings.warn( - "Call to deprecated function rasterImageOffset.", category=DeprecationWarning, stacklevel=2 - ) - return renderWAlphaOffset(image, size, 1, offsets) - - def renderWAlphaOffset( image: Image.Image, size: tuple[int, int], alpha: float = 1.0, offsets: tuple[int, int] = (0, 0) ) -> Image.Image: """Render an image with offset and alpha to a given size. Args: + ---- image (Image.Image): pil image to draw size (tuple[int, int]): width, height as a tuple alpha (float, optional): alpha transparency. Defaults to 1.0. @@ -41,6 +19,7 @@ def renderWAlphaOffset( Defaults to (0, 0). Returns: + ------- Image.Image: new image """ imageOffset = Image.new("RGBA", size) diff --git a/documentation/reference/blendmodes/blend.md b/documentation/reference/blendmodes/blend.md index cce2f0e..71fcf5d 100644 --- a/documentation/reference/blendmodes/blend.md +++ b/documentation/reference/blendmodes/blend.md @@ -1,12 +1,14 @@ # Blend -[Blendmodes Index](../README.md#blendmodes-index) / -[Blendmodes](./index.md#blendmodes) / -Blend +[Blendmodes Index](../README.md#blendmodes-index) / [Blendmodes](./index.md#blendmodes) / Blend > Auto-generated documentation for [blendmodes.blend](../../../blendmodes/blend.py) module. - [Blend](#blend) + - [_lum](#_lum) + - [_sat](#_sat) + - [_setLum](#_setlum) + - [_setSat](#_setsat) - [additive](#additive) - [blend](#blend) - [blendLayers](#blendlayers) @@ -42,6 +44,92 @@ Blend - [vividlight](#vividlight) - [xor](#xor) +## _lum + +[Show source in blend.py:168](../../../blendmodes/blend.py#L168) + +Luminosity. + +#### Arguments + +- `colours` - x by x by 3 matrix of rgb color components of pixels + +#### Returns + +x by x by 3 matrix of luminosity of pixels + +#### Signature + +```python +def _lum(colours: np.ndarray) -> np.ndarray: ... +``` + + + +## _sat + +[Show source in blend.py:205](../../../blendmodes/blend.py#L205) + +Saturation. + +#### Arguments + +- `colours` - x by x by 3 matrix of rgb color components of pixels + +#### Returns + +int of saturation of pixels + +#### Signature + +```python +def _sat(colours: np.ndarray) -> np.ndarray: ... +``` + + + +## _setLum + +[Show source in blend.py:177](../../../blendmodes/blend.py#L177) + +Set a new luminosity value for the matrix of color. + +#### Signature + +```python +def _setLum(originalColours: np.ndarray, newLuminosity: np.ndarray) -> np.ndarray: ... +``` + + + +## _setSat + +[Show source in blend.py:214](../../../blendmodes/blend.py#L214) + +Set a new saturation value for the matrix of color. + +The current implementation cannot be vectorized in an efficient manner, +so it is very slow, +O(m*n) at least. This might be able to be improved with openCL if that is +the direction that the lib takes. + +#### Arguments + +- `c` - x by x by 3 matrix of rgb color components of pixels +- `s` - int of the new saturation value for the matrix + +#### Returns + +x by x by 3 matrix of luminosity of pixels + +#### Signature + +```python +def _setSat(originalColours: np.ndarray, newSaturation: np.ndarray) -> np.ndarray: ... +``` + + + ## additive [Show source in blend.py:41](../../../blendmodes/blend.py#L41) @@ -58,19 +146,21 @@ def additive(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ... ## blend -[Show source in blend.py:387](../../../blendmodes/blend.py#L387) +[Show source in blend.py:391](../../../blendmodes/blend.py#L391) Blend pixels. #### Arguments -- `background` *np.ndarray* - background -- `foreground` *np.ndarray* - foreground -- `blendType` *BlendType* - the blend type +---- + - `background` *np.ndarray* - background + - `foreground` *np.ndarray* - foreground + - `blendType` *BlendType* - the blend type #### Returns -- `np.ndarray` - new array representing the image +------- + - `np.ndarray` - new array representing the image - `background` - np.ndarray, - `foreground` - np.ndarray and the return are in the form @@ -105,20 +195,22 @@ def blend( ## blendLayers -[Show source in blend.py:451](../../../blendmodes/blend.py#L451) +[Show source in blend.py:457](../../../blendmodes/blend.py#L457) Blend layers using numpy array. #### Arguments -- `background` *Image.Image* - background layer -- `foreground` *Image.Image* - foreground layer (must be same size as background) -- `blendType` *BlendType* - The blendtype -- `opacity` *float* - The opacity of the foreground image +---- + - `background` *Image.Image* - background layer + - `foreground` *Image.Image* - foreground layer (must be same size as background) + - `blendType` *BlendType* - The blendtype + - `opacity` *float* - The opacity of the foreground image #### Returns -- `Image.Image` - combined image +------- + - `Image.Image` - combined image #### Signature @@ -222,9 +314,9 @@ also alpha in 'layer above' Destination which overlaps the source, replaces the source. -Fa = 0; Fb = αs -co = αb x Cb x αs -αo = αb x αs +Fa = 0; Fb = as +co = ab x Cb x as +ao = ab x as #### Signature @@ -376,17 +468,19 @@ def hue(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ... ## imageFloatToInt -[Show source in blend.py:372](../../../blendmodes/blend.py#L372) +[Show source in blend.py:374](../../../blendmodes/blend.py#L374) Convert a numpy array representing an image to an array of ints. #### Arguments -- `image` *np.ndarray* - numpy array of floats +---- + - `image` *np.ndarray* - numpy array of floats #### Returns -- `np.ndarray` - numpy array of ints +------- + - `np.ndarray` - numpy array of ints #### Signature @@ -404,11 +498,13 @@ Convert a numpy array representing an image to an array of floats. #### Arguments -- `image` *np.ndarray* - numpy array of ints +---- + - `image` *np.ndarray* - numpy array of ints #### Returns -- `np.ndarray` - numpy array of floats +------- + - `np.ndarray` - numpy array of floats #### Signature diff --git a/documentation/reference/blendmodes/blendtype.md b/documentation/reference/blendmodes/blendtype.md index 09bdbe4..cc5f03f 100644 --- a/documentation/reference/blendmodes/blendtype.md +++ b/documentation/reference/blendmodes/blendtype.md @@ -1,8 +1,6 @@ # BlendType -[Blendmodes Index](../README.md#blendmodes-index) / -[Blendmodes](./index.md#blendmodes) / -BlendType +[Blendmodes Index](../README.md#blendmodes-index) / [Blendmodes](./index.md#blendmodes) / BlendType > Auto-generated documentation for [blendmodes.blendtype](../../../blendmodes/blendtype.py) module. diff --git a/documentation/reference/blendmodes/imagetools.md b/documentation/reference/blendmodes/imagetools.md index 0e0f2b5..b571a6c 100644 --- a/documentation/reference/blendmodes/imagetools.md +++ b/documentation/reference/blendmodes/imagetools.md @@ -1,66 +1,31 @@ # Imagetools -[Blendmodes Index](../README.md#blendmodes-index) / -[Blendmodes](./index.md#blendmodes) / -Imagetools +[Blendmodes Index](../README.md#blendmodes-index) / [Blendmodes](./index.md#blendmodes) / Imagetools > Auto-generated documentation for [blendmodes.imagetools](../../../blendmodes/imagetools.py) module. - [Imagetools](#imagetools) - - [rasterImageOA](#rasterimageoa) - - [rasterImageOffset](#rasterimageoffset) - [renderWAlphaOffset](#renderwalphaoffset) -## rasterImageOA - -[Show source in imagetools.py:11](../../../blendmodes/imagetools.py#L11) - -#### Signature - -```python -@deprecated(deprecated_in="2021.1", removed_in="", details="use renderWAlphaOffset") -def rasterImageOA( - image: Image.Image, - size: tuple[int, int], - alpha: float = 1.0, - offsets: tuple[int, int] = (0, 0), -) -> Image.Image: ... -``` - - - -## rasterImageOffset - -[Show source in imagetools.py:21](../../../blendmodes/imagetools.py#L21) - -#### Signature - -```python -@deprecated(deprecated_in="2021.1", removed_in="", details="use renderWAlphaOffset") -def rasterImageOffset( - image: Image.Image, size: tuple[int, int], offsets: tuple[int, int] = (0, 0) -) -> Image.Image: ... -``` - - - ## renderWAlphaOffset -[Show source in imagetools.py:31](../../../blendmodes/imagetools.py#L31) +[Show source in imagetools.py:8](../../../blendmodes/imagetools.py#L8) Render an image with offset and alpha to a given size. #### Arguments -- `image` *Image.Image* - pil image to draw -size (tuple[int, int]): width, height as a tuple -- `alpha` *float, optional* - alpha transparency. Defaults to 1.0. -offsets (tuple[int, int], optional): x, y offsets as a tuple. -Defaults to (0, 0). +---- + - `image` *Image.Image* - pil image to draw + size (tuple[int, int]): width, height as a tuple + - `alpha` *float, optional* - alpha transparency. Defaults to 1.0. + offsets (tuple[int, int], optional): x, y offsets as a tuple. + Defaults to (0, 0). #### Returns -- `Image.Image` - new image +------- + - `Image.Image` - new image #### Signature diff --git a/documentation/reference/blendmodes/index.md b/documentation/reference/blendmodes/index.md index f77f05c..fbe83bb 100644 --- a/documentation/reference/blendmodes/index.md +++ b/documentation/reference/blendmodes/index.md @@ -1,7 +1,6 @@ # Blendmodes -[Blendmodes Index](../README.md#blendmodes-index) / -Blendmodes +[Blendmodes Index](../README.md#blendmodes-index) / Blendmodes > Auto-generated documentation for [blendmodes](../../../blendmodes/__init__.py) module. diff --git a/pyproject.toml b/pyproject.toml index daac8db..8cd4618 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "blendmodes" -version = "2024" +version = "2024.0.1" license = "mit" description = "Use this module to apply a number of blending modes to a background and foreground image" authors = ["FredHappyface"] @@ -21,52 +21,56 @@ documentation = "https://github.com/FHPythonUtils/BlendModes/blob/master/README. readme = "README.md" [tool.poetry.dependencies] -python = ">=3.8,<4.0" -Pillow = "<11,>=10.0.0" -numpy = "<2,>=1.22.1" +python = ">=3.9,<4.0" +Pillow = "<11,>=10.2.0" +numpy = "<2,>=1.26.3" aenum = "<4,>=3.1.15" -deprecation = "<3,>=2.1.0" [tool.poetry.group.dev.dependencies] imgcompare = "^2.0.1" -pytest = "^7.4.0" -pylint = "^2.17.5" -handsdown = "^2.0.1" -coverage = "^7.3.0" - -[tool.black] -line-length = 100 -target-version = ["py38"] - -[tool.isort] -profile = "black" -indent = "Tab" - -[tool.pydocstyle] -convention = "google" -ignore = "D205,D415" +pytest = "^7.4.4" +handsdown = "^2.1.0" +coverage = "^7.4.0" +ruff = "^0.1.13" +blackt = "^2024.0.1" +pyright = "^1.1.347" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" -[tool.pylint.basic] -argument-naming-style = "camelCase" -attr-naming-style = "camelCase" -function-naming-style = "camelCase" -method-naming-style = "camelCase" -variable-naming-style = "camelCase" -[tool.pylint.format] -indent-string = "\t" -[tool.pylint.master] -ignore-paths = ["tests"] +[tool.ruff] +line-length = 100 +indent-width = 4 +target-version = "py38" + +[tool.ruff.lint] +select = ["ALL"] +ignore = [ + "ANN101", # type annotation for self in method + "COM812", # enforce trailing comma + "D2", # pydocstyle formatting + "N", # pep8 naming + "PLR09", # pylint refactor too many + "TCH", # type check blocks + "W191" # ignore this to allow tabs +] +fixable = ["ALL"] + + +[tool.ruff.lint.per-file-ignores] +"**/{tests,docs,tools}/*" = ["D", "S101", "E402"] + +[tool.black] +line-length = 100 +target-version = ["py38"] -[tool.pylint.messages_control] -enable = ["F", "E", "W", "R", "C"] -disable = ["pointless-string-statement", "superfluous-parens"] +[tool.pyright] +venvPath = "." +venv = ".venv" [tool.tox] legacy_tox_ini = """ diff --git a/requirements.txt b/requirements.txt index 53bc24a..14c6885 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -Pillow<11,>=10.0.0 +Pillow<11,>=10.2.0 aenum<4,>=3.1.15 -deprecation<3,>=2.1.0 -numpy<2,>=1.22.1 +numpy<2,>=1.26.3 diff --git a/tests/__init__.py b/tests/__init__.py index 8b13789..e69de29 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1 +0,0 @@ - diff --git a/tests/test_main.py b/tests/test_main.py index b134271..c5667ec 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -13,10 +13,8 @@ from blendmodes.blend import BlendType, blendLayers -# pylint:disable=invalid-name - -def test_normal(): +def test_normal() -> None: """Test normal.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -27,7 +25,7 @@ def test_normal(): ) -def test_multiply(): +def test_multiply() -> None: """Test multiply.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -38,7 +36,7 @@ def test_multiply(): ) -def test_additive(): +def test_additive() -> None: """Test additive.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -49,7 +47,7 @@ def test_additive(): ) -def test_colourburn(): +def test_colourburn() -> None: """Test colourburn.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -60,7 +58,7 @@ def test_colourburn(): ) -def test_colourdodge(): +def test_colourdodge() -> None: """Test colourdodge.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -71,7 +69,7 @@ def test_colourdodge(): ) -def test_reflect(): +def test_reflect() -> None: """Test reflect.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -82,7 +80,7 @@ def test_reflect(): ) -def test_glow(): +def test_glow() -> None: """Test glow.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -93,7 +91,7 @@ def test_glow(): ) -def test_overlay(): +def test_overlay() -> None: """Test overlay.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -104,7 +102,7 @@ def test_overlay(): ) -def test_difference(): +def test_difference() -> None: """Test difference.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -115,7 +113,7 @@ def test_difference(): ) -def test_negation(): +def test_negation() -> None: """Test negation.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -126,7 +124,7 @@ def test_negation(): ) -def test_lighten(): +def test_lighten() -> None: """Test lighten.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -137,7 +135,7 @@ def test_lighten(): ) -def test_darken(): +def test_darken() -> None: """Test darken.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -148,7 +146,7 @@ def test_darken(): ) -def test_screen(): +def test_screen() -> None: """Test screen.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -159,7 +157,7 @@ def test_screen(): ) -def test_xor(): +def test_xor() -> None: """Test xor.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -170,7 +168,7 @@ def test_xor(): ) -def test_softlight(): +def test_softlight() -> None: """Test softlight.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -181,7 +179,7 @@ def test_softlight(): ) -def test_hardlight(): +def test_hardlight() -> None: """Test hardlight.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -192,7 +190,7 @@ def test_hardlight(): ) -def test_grainextract(): +def test_grainextract() -> None: """Test grainextract.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -203,7 +201,7 @@ def test_grainextract(): ) -def test_grainmerge(): +def test_grainmerge() -> None: """Test grainmerge.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -214,7 +212,7 @@ def test_grainmerge(): ) -def test_divide(): +def test_divide() -> None: """Test divide.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -225,7 +223,7 @@ def test_divide(): ) -def test_hue(): +def test_hue() -> None: """Test hue.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -236,7 +234,7 @@ def test_hue(): ) -def test_saturation(): +def test_saturation() -> None: """Test saturation.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -247,7 +245,7 @@ def test_saturation(): ) -def test_colour(): +def test_colour() -> None: """Test colour.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -258,7 +256,7 @@ def test_colour(): ) -def test_luminosity(): +def test_luminosity() -> None: """Test luminosity.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -269,7 +267,7 @@ def test_luminosity(): ) -def test_pinlight(): +def test_pinlight() -> None: """Test pinlight.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -280,7 +278,7 @@ def test_pinlight(): ) -def test_vividlight(): +def test_vividlight() -> None: """Test vividlight.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -291,7 +289,7 @@ def test_vividlight(): ) -def test_exclusion(): +def test_exclusion() -> None: """Test exclusion.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -302,7 +300,7 @@ def test_exclusion(): ) -def test_destin(): +def test_destin() -> None: """Test destin.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -313,7 +311,7 @@ def test_destin(): ) -def test_destout(): +def test_destout() -> None: """Test destout.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -324,7 +322,7 @@ def test_destout(): ) -def test_destatop(): +def test_destatop() -> None: """Test destatop.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -335,7 +333,7 @@ def test_destatop(): ) -def test_srcatop(): +def test_srcatop() -> None: """Test srcatop.""" background = Image.open(f"{THISDIR}/data/background.png") foreground = Image.open(f"{THISDIR}/data/foreground.png") @@ -346,7 +344,7 @@ def test_srcatop(): ) -def test_non_rgba(): +def test_non_rgba() -> None: background = Image.open(f"{THISDIR}/data/background.jpg") foreground = Image.open(f"{THISDIR}/data/foreground.jpg") blendLayers(background, foreground, BlendType.NORMAL)